fix: making sure the log was sent before setting the status

This commit is contained in:
bennykok 2024-02-01 21:04:24 +08:00
parent ffe0f98360
commit 72fee51d32

View File

@ -259,7 +259,6 @@ def update_run(prompt_id, status: Status):
"run_id": prompt_id, "run_id": prompt_id,
"status": status.value, "status": status.value,
} }
prompt_metadata[prompt_id]['status'] = status
print(f"Status: {status.value}") print(f"Status: {status.value}")
try: try:
@ -297,6 +296,8 @@ def update_run(prompt_id, status: Status):
error_type = type(e).__name__ error_type = type(e).__name__
stack_trace = traceback.format_exc().strip() stack_trace = traceback.format_exc().strip()
print(f"Error occurred while updating run: {e} {stack_trace}") print(f"Error occurred while updating run: {e} {stack_trace}")
finally:
prompt_metadata[prompt_id]['status'] = status
async def upload_file(prompt_id, filename, subfolder=None, content_type="image/png", type="output"): async def upload_file(prompt_id, filename, subfolder=None, content_type="image/png", type="output"):