1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Remove another usage of API within server code

This commit is contained in:
Mike Perham 2022-08-05 10:54:54 -07:00
parent 77fc95a630
commit e464c09ca1

View file

@ -152,8 +152,14 @@ module Sidekiq
job_hash = Sidekiq.load_json(jobstr)
rescue => ex
handle_exception(ex, {context: "Invalid JSON for job", jobstr: jobstr})
# we can't notify because the job isn't a valid hash payload.
DeadSet.new.kill(jobstr, notify_failure: false)
now = Time.now.to_f
config.redis do |conn|
conn.multi do |xa|
xa.zadd("dead", now.to_s, jobstr)
xa.zremrangebyscore("dead", "-inf", now - config[:dead_timeout_in_seconds])
xa.zremrangebyrank("dead", 0, - config[:dead_max_jobs])
end
end
return uow.acknowledge
end