How to destroy jobs enqueued by resque workers?

前端 未结 7 1994
日久生厌
日久生厌 2021-01-30 05:22

I\'m using Resque on a rails-3 project to handle jobs that are scheduled to run every 5 minutes. I recently did something that snowballed the creation of these jobs and the stac

7条回答
  •  深忆病人
    2021-01-30 06:05

    It's safer and bulletproof to use the Resque API rather than deleting everything on the Resque's Redis. Resque does some cleaning in the inside.

    If you want to remove all queues and associated enqueued jobs:

    Resque.queues.each {|queue| Resque.remove_queue(queue)}
    

    The queues will be re-created the next time a job is enqueued.

    Documentation

提交回复
热议问题