Skip to content

Commit 81ec222

Browse files
committed
Queues should self register themselves
1 parent 12d975c commit 81ec222

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

lib/resque.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ def to_s
140140
#
141141
# Returns nothing
142142
def push(queue, item)
143-
watch_queue(queue)
144143
@queues[queue] << item
145144
end
146145

@@ -196,12 +195,6 @@ def remove_queue(queue)
196195
@queues[queue].destroy
197196
end
198197

199-
# Used internally to keep track of which queues we've created.
200-
# Don't call this directly.
201-
def watch_queue(queue)
202-
redis.sadd(:queues, queue.to_s)
203-
end
204-
205198

206199
#
207200
# job shortcuts

lib/resque/queue.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def initialize name, redis, coder = Marshal
2424

2525
# Add +object+ to the queue
2626
def push object
27+
@redis.sadd(:queues, @name)
28+
2729
synchronize do
2830
@redis.rpush @redis_name, encode(object)
2931
end

0 commit comments

Comments
 (0)