Log the exception if the worker fails.
This commit is contained in:
parent
e39d99b2ac
commit
edee5e6b58
3 changed files with 19 additions and 15 deletions
15
worker.py
15
worker.py
|
|
@ -81,12 +81,15 @@ class Worker:
|
|||
|
||||
def main():
|
||||
print(os.getpid(), flush=True)
|
||||
while True:
|
||||
tool_name, path = input(), input()
|
||||
tool = getattr(tools, tool_name)
|
||||
result = tools.Result(path, tool)
|
||||
status, result.result = tools.run_tool_no_error(path, tool)
|
||||
print(status.value, flush=True)
|
||||
try:
|
||||
while True:
|
||||
tool_name, path = input(), input()
|
||||
tool = getattr(tools, tool_name)
|
||||
result = tools.Result(path, tool)
|
||||
status, result.result = tools.run_tool_no_error(path, tool)
|
||||
print(status.value, flush=True)
|
||||
except:
|
||||
tools.log_error()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue