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:
parent
77fc95a630
commit
e464c09ca1
1 changed files with 8 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue