lib/rocket_job/plugins/job/worker.rb in rocketjob-3.5.2 vs lib/rocket_job/plugins/job/worker.rb in rocketjob-4.0.0
- old
+ new
@@ -49,11 +49,11 @@
# Restore retrieved job so that other workers can process it later
job.set(worker_name: nil, state: :queued)
else
job.worker_name = worker_name
job.rocket_job_fail_on_exception!(worker_name) do
- defined?(RocketJobPro) ? job.start! : job.start
+ job.start!
end
return job if job.running?
end
end
end
@@ -103,10 +103,10 @@
# * before_create
# * after_create
#
# Exceptions are _not_ suppressed and should be handled by the caller.
def perform_now
- raise(Mongoid::Errors::Validations, self) unless valid?
+ raise(::Mongoid::Errors::Validations, self) unless valid?
worker = RocketJob::Worker.new(inline: true)
start if may_start?
# Re-Raise exceptions
rocket_job_work(worker, true) if running?