summaryrefslogtreecommitdiff
path: root/lorrycontroller/jobupdate.py
diff options
context:
space:
mode:
Diffstat (limited to 'lorrycontroller/jobupdate.py')
-rw-r--r--lorrycontroller/jobupdate.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lorrycontroller/jobupdate.py b/lorrycontroller/jobupdate.py
index efc9ce1..51a1bf4 100644
--- a/lorrycontroller/jobupdate.py
+++ b/lorrycontroller/jobupdate.py
@@ -51,6 +51,12 @@ class JobUpdate(lorrycontroller.LorryControllerRoute):
lorry_info = statedb.get_lorry_info(path)
if exit is not None and exit != 'no':
+ # Get output if enabled, and if failure
+ if self.app_settings['publish-failures'] and exit != '0':
+ job_output = statedb.get_job_output(job_id)
+ else:
+ job_output = ''
+ statedb.set_lorry_last_run_exit_and_output(path, exit, job_output)
statedb.set_lorry_last_run(path, int(now))
statedb.set_running_job(path, None)
statedb.set_job_exit(job_id, exit, int(now), disk_usage)