summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Hesketh <josh@nitrotech.org>2015-02-24 17:35:07 +1100
committerJoshua Hesketh <josh@nitrotech.org>2015-02-24 17:35:07 +1100
commitf4b2038732a8e4158bc9469a44c9e58f9cd963db (patch)
treecc1782c5562f58b234756fc28256ad3d864b54a8
parentf924677d541317150f0763f680cb6d9d921380bf (diff)
downloadturbo-hipster-f4b2038732a8e4158bc9469a44c9e58f9cd963db.tar.gz
Send results back on failure
Change-Id: I2ffb64c4c96ab5d600e6381a74bf0c5080618ea3
-rw-r--r--turbo_hipster/lib/models.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/turbo_hipster/lib/models.py b/turbo_hipster/lib/models.py
index 4b0afbd..7029aea 100644
--- a/turbo_hipster/lib/models.py
+++ b/turbo_hipster/lib/models.py
@@ -121,6 +121,7 @@ class Task(object):
self._send_work_data()
self.job.sendWorkException(str(e).encode('utf-8'))
# No point trying the job, lets return here
+ self._send_final_results()
return
# From here we can log exceptions
@@ -140,8 +141,6 @@ class Task(object):
try:
self._cleanup()
self._upload_results()
- # Finally, send updated work data and completed packets
- self._send_final_results()
except Exception as e:
# If something failed during this section we have been unable
# to upload the log. As such raise an exception to gearman
@@ -154,6 +153,9 @@ class Task(object):
self.messages.append('Exception: %s' % e)
self._send_work_data()
self.job.sendWorkException(str(e).encode('utf-8'))
+ finally:
+ # Finally, send updated work data and completed packets
+ self._send_final_results()
def stop_working(self, number=None):
# Check the number is for this job instance (None will cancel all)