RQ - Empty & Delete Queues

前端 未结 7 1396
傲寒
傲寒 2021-02-02 13:44

I\'m using RQ, and I have a failed queue with thousands of items, and another test queue I created a while back for testing which is now empty and unus

7条回答
  •  广开言路
    2021-02-02 14:19

    Here's how to clear the failed job registry using django_rq:

    import django_rq
    from rq.registry import FailedJobRegistry
    
    queue = django_rq.get_queue("your_queue_with_failed_jobs")
    registry = FailedJobRegistry(queue=queue)
    
    for job_id in registry.get_job_ids():
      registry.remove(job_id)
    

提交回复
热议问题