Added newlines against buffering
This commit is contained in:
@@ -36,7 +36,7 @@ def setup_app() -> FastAPI:
|
|||||||
app.add_exception_handler(
|
app.add_exception_handler(
|
||||||
utils.NixBuildException, utils.nix_build_exception_handler
|
utils.NixBuildException, utils.nix_build_exception_handler
|
||||||
)
|
)
|
||||||
|
|
||||||
app.mount("/static", StaticFiles(directory=asset_path()), name="static")
|
app.mount("/static", StaticFiles(directory=asset_path()), name="static")
|
||||||
|
|
||||||
for route in app.routes:
|
for route in app.routes:
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class CmdState:
|
|||||||
line = line.strip("\n")
|
line = line.strip("\n")
|
||||||
self.stderr.append(line)
|
self.stderr.append(line)
|
||||||
self.log.debug("stderr: %s", line)
|
self.log.debug("stderr: %s", line)
|
||||||
self._output.put(line)
|
self._output.put(line + '\n')
|
||||||
|
|
||||||
if self.p.stdout in rlist:
|
if self.p.stdout in rlist:
|
||||||
assert self.p.stdout is not None
|
assert self.p.stdout is not None
|
||||||
@@ -63,7 +63,7 @@ class CmdState:
|
|||||||
line = line.strip("\n")
|
line = line.strip("\n")
|
||||||
self.stdout.append(line)
|
self.stdout.append(line)
|
||||||
self.log.debug("stdout: %s", line)
|
self.log.debug("stdout: %s", line)
|
||||||
self._output.put(line)
|
self._output.put(line + '\n')
|
||||||
|
|
||||||
if self.p.returncode != 0:
|
if self.p.returncode != 0:
|
||||||
raise RuntimeError(f"Failed to run command: {shlex.join(cmd)}")
|
raise RuntimeError(f"Failed to run command: {shlex.join(cmd)}")
|
||||||
@@ -109,9 +109,9 @@ class BaseTask(threading.Thread):
|
|||||||
break
|
break
|
||||||
if proc.done:
|
if proc.done:
|
||||||
for line in proc.stderr:
|
for line in proc.stderr:
|
||||||
yield line
|
yield line + '\n'
|
||||||
for line in proc.stdout:
|
for line in proc.stdout:
|
||||||
yield line
|
yield line + '\n'
|
||||||
continue
|
continue
|
||||||
while True:
|
while True:
|
||||||
out = proc._output
|
out = proc._output
|
||||||
|
|||||||
Reference in New Issue
Block a user