summaryrefslogtreecommitdiff
path: root/lorrycontroller/jobupdate.py
diff options
context:
space:
mode:
Diffstat (limited to 'lorrycontroller/jobupdate.py')
-rw-r--r--lorrycontroller/jobupdate.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lorrycontroller/jobupdate.py b/lorrycontroller/jobupdate.py
index efc9ce1..ec7e533 100644
--- a/lorrycontroller/jobupdate.py
+++ b/lorrycontroller/jobupdate.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2014 Codethink Limited
+# Copyright (C) 2014-2017 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -51,6 +51,11 @@ class JobUpdate(lorrycontroller.LorryControllerRoute):
lorry_info = statedb.get_lorry_info(path)
if exit is not None and exit != 'no':
+ if 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)