logfile sanity check

This commit is contained in:
Fabian Dill 2020-06-14 08:11:56 +02:00
parent 4e6f976e1d
commit 48aff48740
1 changed files with 6 additions and 4 deletions

View File

@ -86,8 +86,11 @@ def upload_multidata():
def _read_log(path: str):
with open(path) as log:
yield from log
if os.path.exists(path):
with open(path) as log:
yield from log
else:
yield "Logfile does not exist. Likely a crash during spinup of multiworld instance."
@app.route('/log/<filename>')
@ -140,8 +143,7 @@ def run_server_process(multidata: str):
if ".." not in sys.path:
sys.path.append("..")
from MultiServer import Context, server
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
if __name__ == "__main__":