Skip to content

Commit 0f296e3

Browse files
committed
Explain @watched_queues
1 parent 6c8ed8f commit 0f296e3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/resque.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ def remove_queue(queue)
111111
# Used internally to keep track of which queues we've created.
112112
# Don't call this directly.
113113
def watch_queue(queue)
114+
# In order to avoid hitting Redis every time a job is queued we
115+
# cache the list of known queues.
114116
@watched_queues ||= {}
115117
return if @watched_queues[queue]
116118
redis.sadd(:queues, queue.to_s)

0 commit comments

Comments
 (0)