Browse files

Queues should self register themselves

  • Loading branch information...
1 parent 12d975c commit 81ec2228e54886f395a57bab18e38b7ff9b124af @hone hone committed Apr 5, 2012
Showing with 2 additions and 7 deletions.
  1. +0 −7 lib/resque.rb
  2. +2 −0 lib/resque/queue.rb
View
7 lib/resque.rb
@@ -140,7 +140,6 @@ def to_s
#
# Returns nothing
def push(queue, item)
- watch_queue(queue)
@queues[queue] << item
end
@@ -196,12 +195,6 @@ def remove_queue(queue)
@queues[queue].destroy
end
- # Used internally to keep track of which queues we've created.
- # Don't call this directly.
- def watch_queue(queue)
- redis.sadd(:queues, queue.to_s)
- end
-
#
# job shortcuts
View
2 lib/resque/queue.rb
@@ -24,6 +24,8 @@ def initialize name, redis, coder = Marshal
# Add +object+ to the queue
def push object
+ @redis.sadd(:queues, @name)
+
synchronize do
@redis.rpush @redis_name, encode(object)
end

0 comments on commit 81ec222

Please sign in to comment.