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!
This commit is contained in:
David Heinemeier Hansson 2016-08-01 16:02:50 -07:00
parent 779148d390
commit a4fc7dc957
2 changed files with 2 additions and 1 deletions

@ -83,7 +83,7 @@ def serialize
'queue_name' => queue_name,
'priority' => priority,
'arguments' => serialize_arguments(arguments),
'executions' => executions + 1,
'executions' => executions,
'locale' => I18n.locale.to_s
}
end

@ -31,6 +31,7 @@ def execute(job_data) #:nodoc:
def perform_now
deserialize_arguments_if_needed
run_callbacks :perform do
self.executions = executions + 1
perform(*arguments)
end
rescue => exception