From a4fc7dc9577cb6476d8f11682cb5b853149c23fc Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 1 Aug 2016 16:02:50 -0700 Subject: Executions counting is not a serialization concern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let’s do it when we actually execute instead. Then the tests dealing with comparable serializations won’t fail either! --- activejob/lib/active_job/core.rb | 2 +- activejob/lib/active_job/execution.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3