lib/rocket_job/batch/worker.rb in rocketjob-6.2.0 vs lib/rocket_job/batch/worker.rb in rocketjob-6.3.0
- old
+ new
@@ -224,11 +224,11 @@
# Complete job iff no other worker has already completed it
# Must set write concern to at least 1 since we need the nModified back
result = self.class.with(write: {w: 1}) do |query|
query.
where(id: id, state: :running, sub_state: :processing).
- update("$set" => {sub_state: :after, worker_name: worker_name})
+ update("$set" => {sub_state: "after", worker_name: worker_name})
end
# Reload to pull in any counters or other data that was modified.
reload
@@ -249,10 +249,10 @@
# Fail job iff no other worker has already finished it
# Must set write concern to at least 1 since we need the nModified back
result = self.class.with(write: {w: 1}) do |query|
query.
where(id: id, state: :running, sub_state: :processing).
- update({"$set" => {state: :failed, worker_name: worker_name}})
+ update({"$set" => {state: "failed", worker_name: worker_name}})
end
fail_job = false unless result.modified_count.positive?
end
return unless fail_job