mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
15 lines
308 B
Ruby
15 lines
308 B
Ruby
module Sidekiq
|
|
module Middleware
|
|
module Server
|
|
class UniqueJobs
|
|
def call(*args)
|
|
yield
|
|
ensure
|
|
json = MultiJson.encode(args[1])
|
|
hash = Digest::MD5.hexdigest(json)
|
|
Sidekiq.redis {|conn| conn.del(hash) }
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|