1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00
mperham--sidekiq/lib/sidekiq/middleware/server/unique_jobs.rb
Mike Perham 2c4be4cada Scheduled jobs! Bump to 2.0.0.
Performs can now be scheduled at arbitrary points in the future.
2012-05-25 20:21:42 -07:00

15 lines
309 B
Ruby

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