Skip to content

Commit

Permalink
Explain @watched_queues
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Dec 11, 2009
1 parent 6c8ed8f commit 0f296e3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/resque.rb
Expand Up @@ -111,6 +111,8 @@ def remove_queue(queue)
# Used internally to keep track of which queues we've created.
# Don't call this directly.
def watch_queue(queue)
# In order to avoid hitting Redis every time a job is queued we
# cache the list of known queues.
@watched_queues ||= {}
return if @watched_queues[queue]
redis.sadd(:queues, queue.to_s)
Expand Down

0 comments on commit 0f296e3

Please sign in to comment.