diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2016-08-01 16:02:50 -0700 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2016-08-01 16:02:50 -0700 |
commit | a4fc7dc9577cb6476d8f11682cb5b853149c23fc (patch) | |
tree | 41630d50a7b9734c1bb47023bbb7611df979be09 | |
parent | 779148d390485dd4e013a9dc7a6608fb1e43b7ef (diff) | |
download | rails-a4fc7dc9577cb6476d8f11682cb5b853149c23fc.tar.gz rails-a4fc7dc9577cb6476d8f11682cb5b853149c23fc.tar.bz2 rails-a4fc7dc9577cb6476d8f11682cb5b853149c23fc.zip |
Executions counting is not a serialization concern
Let’s do it when we actually execute instead. Then the tests dealing
with comparable serializations won’t fail either!
-rw-r--r-- | activejob/lib/active_job/core.rb | 2 | ||||
-rw-r--r-- | activejob/lib/active_job/execution.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/activejob/lib/active_job/core.rb b/activejob/lib/active_job/core.rb index a9ddd029a8..1b5ddff17b 100644 --- a/activejob/lib/active_job/core.rb +++ b/activejob/lib/active_job/core.rb @@ -83,7 +83,7 @@ module ActiveJob 'queue_name' => queue_name, 'priority' => priority, 'arguments' => serialize_arguments(arguments), - 'executions' => executions + 1, + 'executions' => executions, 'locale' => I18n.locale.to_s } end diff --git a/activejob/lib/active_job/execution.rb b/activejob/lib/active_job/execution.rb index 4e4acfc2c2..0c047cd4e1 100644 --- a/activejob/lib/active_job/execution.rb +++ b/activejob/lib/active_job/execution.rb @@ -31,6 +31,7 @@ module ActiveJob def perform_now deserialize_arguments_if_needed run_callbacks :perform do + self.executions = executions + 1 perform(*arguments) end rescue => exception |