lib/rocket_job/plugins/job/state_machine.rb in rocketjob-3.0.3 vs lib/rocket_job/plugins/job/state_machine.rb in rocketjob-3.0.4

- old
+ new

@@ -17,11 +17,11 @@ # -> :failed -> :aborted # -> :queued # -> :aborted # -> :queued (when a worker dies) # -> :aborted - aasm column: :state do + aasm column: :state, whiny_persistence: true do # Job has been created and is queued for processing ( Initial state ) state :queued, initial: true # Job is running state :running @@ -74,10 +74,10 @@ transitions from: :paused, to: :aborted end event :requeue do transitions from: :running, to: :queued, - if: -> server_name { worker_name.to_s.start_with?(server_name) }, + if: -> server_name { worker_on_server?(server_name) }, after: :rocket_job_clear_started_at end end # @formatter:on