Skip to content
Snippets Groups Projects
Commit a12e8418 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Log when jobs finish

parent bfb936e7
No related branches found
No related tags found
1 merge request!441Refactor 'webservice' ZMQ server
...@@ -377,6 +377,11 @@ async def update_job_db(config): ...@@ -377,6 +377,11 @@ async def update_job_db(config):
flgs, statii = combined[rid, action] flgs, statii = combined[rid, action]
# sort by least done status # sort by least done status
flg = max(flgs, key=lambda i: flg_order[i]) flg = max(flgs, key=lambda i: flg_order[i])
if flg != 'R':
logging.info(
"Jobs finished - action: %s, run id: %s, status: %s",
action, rid, flg,
)
msg = "\n".join(statii) msg = "\n".join(statii)
msg_debug = f"Update MDC {rid}, {msg}" msg_debug = f"Update MDC {rid}, {msg}"
logging.debug(msg_debug.replace('\n', ', ')) logging.debug(msg_debug.replace('\n', ', '))
...@@ -392,9 +397,8 @@ async def update_job_db(config): ...@@ -392,9 +397,8 @@ async def update_job_db(config):
logging.error("Failed to update MDC for action %s, rid %s", logging.error("Failed to update MDC for action %s, rid %s",
action, rid) action, rid)
logging.error(Errors.MDC_RESPONSE.format(response)) logging.error(Errors.MDC_RESPONSE.format(response))
except Exception as e: except Exception:
e = str(e) logging.error(f"Failure to update job DB", exc_info=True)
logging.error(f"Failure to update job DB: {e}")
await asyncio.sleep(time_interval) await asyncio.sleep(time_interval)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment