Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #140 from sontek/always_run_after_perform
Browse files Browse the repository at this point in the history
Always run after_perform, you should check 'failed' key
  • Loading branch information
binarymatt committed Sep 1, 2014
2 parents 49aebb2 + 943a4a2 commit 89811a7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyres/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down

0 comments on commit 89811a7

Please sign in to comment.