Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用rq和 RedisToGo。如何获取队列中的作业数量?我在文档中找不到?(在 Python 中)
当我尝试:
print "Before: ", len(q.jobs) result = q.enqueue(worker.A) result = q.enqueue(worker.B) print "After: ", len(q.jobs)
它只是给 0 两次。
对于 RQ,您应该能够仅获取len队列中的作业:
len
from rq import Queue queue = Queue() len(queue.jobs)