mirror of
https://github.com/simon987/sist2.git
synced 2025-04-19 10:16:42 +00:00
Fix #332
This commit is contained in:
parent
b17f3ff924
commit
8b9b067c06
@ -277,23 +277,17 @@ class Sist2:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def _consume_logs_stdout(logs_cb, proc):
|
def _consume_logs_stdout(logs_cb, proc):
|
||||||
pipe_wrapper = TextIOWrapper(proc.stdout, encoding="utf8", errors="ignore")
|
pipe_wrapper = TextIOWrapper(proc.stdout, encoding="utf8", errors="ignore")
|
||||||
try:
|
for line in pipe_wrapper:
|
||||||
for line in pipe_wrapper:
|
try:
|
||||||
if line.strip() == "":
|
if line.strip() == "":
|
||||||
continue
|
continue
|
||||||
log_object = json.loads(line)
|
log_object = json.loads(line)
|
||||||
logs_cb(log_object)
|
logs_cb(log_object)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
proc.kill()
|
try:
|
||||||
try:
|
logs_cb({"sist2-admin": f"Could not decode log line: {line}; {e}"})
|
||||||
print(line)
|
except NameError:
|
||||||
except NameError:
|
pass
|
||||||
pass
|
|
||||||
print(traceback.format_exc())
|
|
||||||
finally:
|
|
||||||
pass
|
|
||||||
# proc.wait()
|
|
||||||
# pipe_wrapper.close()
|
|
||||||
|
|
||||||
def web(self, options: WebOptions, name: str):
|
def web(self, options: WebOptions, name: str):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user