mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
add resque web compatability middleware
This commit is contained in:
parent
78aad94817
commit
8caa3ee950
2 changed files with 19 additions and 0 deletions
|
@ -3,6 +3,7 @@ require 'redis'
|
|||
|
||||
require 'sidekiq/redis_connection'
|
||||
require 'sidekiq/middleware/chain'
|
||||
require 'sidekiq/middleware/client/resque_web_compatability'
|
||||
require 'sidekiq/middleware/client/unique_jobs'
|
||||
|
||||
module Sidekiq
|
||||
|
|
18
lib/sidekiq/middleware/client/resque_web_compatability.rb
Normal file
18
lib/sidekiq/middleware/client/resque_web_compatability.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
module Sidekiq
|
||||
module Middleware
|
||||
module Client
|
||||
class ResqueWebCompatability
|
||||
def initialize(redis)
|
||||
@redis = redis
|
||||
end
|
||||
|
||||
#Add job queue to list of queues resque web displays
|
||||
def call(item, queue)
|
||||
@redis.sadd('queues', queue)
|
||||
|
||||
yield
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue