mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
![Erik Michaels-Ober](/assets/img/avatar_default.png)
These methods perform MultiJson feature detection and can be removed after this library's MultiJson dependency is upgraded to ~> 2.0.
17 lines
331 B
Ruby
17 lines
331 B
Ruby
require 'multi_json'
|
|
|
|
module Sidekiq
|
|
module Middleware
|
|
module Server
|
|
class UniqueJobs
|
|
def call(*args)
|
|
yield
|
|
ensure
|
|
json = Sidekiq.dump_json(args[1])
|
|
hash = Digest::MD5.hexdigest(json)
|
|
Sidekiq.redis {|conn| conn.del(hash) }
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|