From db054a2e848943f888d9b84784163c4cff70035c Mon Sep 17 00:00:00 2001 From: Di Xu Date: Tue, 14 Jan 2020 12:44:55 -0800 Subject: [PATCH] notify user about job status changes (#767) --- src/ClusterManager/job_manager.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ClusterManager/job_manager.py b/src/ClusterManager/job_manager.py index 99cebffea..d7c3dec4d 100755 --- a/src/ClusterManager/job_manager.py +++ b/src/ClusterManager/job_manager.py @@ -333,6 +333,9 @@ def UpdateJobStatus(redis_conn, launcher, job, notifier=None, dataHandlerOri=Non } conditionFields = {"jobId": job["jobId"]} dataHandler.UpdateJobTextFields(conditionFields, dataFields) + if notifier is not None: + notifier.notify(notify.new_job_state_change_message( + job["userName"], job["jobId"], result.strip())) elif result == "Failed": logger.warning("Job %s fails, cleaning...", job["jobId"]) @@ -384,6 +387,9 @@ def UpdateJobStatus(redis_conn, launcher, job, notifier=None, dataHandlerOri=Non logger.warning("Job {} fails in Kubernetes as {}, delete and re-submit.".format(job["jobId"], result)) launcher.kill_job(job["jobId"], "queued") + if notifier is not None: + notifier.notify(notify.new_job_state_change_message( + job["userName"], job["jobId"], result.strip())) elif result == "Pending": detail = get_scheduling_job_details(details)