From 943a4a2808656a532fd9ab095b9df93833b81637 Mon Sep 17 00:00:00 2001 From: John Anderson Date: Wed, 6 Aug 2014 08:40:23 -0700 Subject: [PATCH] Always run after_perform, you should check 'failed' key --- pyres/job.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyres/job.py b/pyres/job.py index 8358494..4f4b547 100644 --- a/pyres/job.py +++ b/pyres/job.py @@ -82,7 +82,6 @@ def perform(self): payload_class.before_perform(metadata) return payload_class.perform(*args) except Exception as e: - check_after = False metadata["failed"] = True metadata["exception"] = e if not self.retry(payload_class, args): @@ -93,8 +92,10 @@ def perform(self): logging.exception("Retry scheduled after error in %s", self._payload) finally: after_perform = getattr(payload_class, "after_perform", None) - if after_perform and check_after: + + if after_perform: payload_class.after_perform(metadata) + delattr(payload_class,'resq') def fail(self, exception):