librelist archives

« back to archive

Deleting Queues?

Deleting Queues?

From:
Jonathan
Date:
2009-11-13 @ 20:15
Hi,

The answer to this question is probably right in-front of me,  
nevertheless I've spent a bit of time in the docs, and playing-around  
in script/console (i.e. w/ the list of Resque.methods), but I'm not  
finding it.

Would someone please tell me how-to remove a queue?

i.e. Resque.queues.delete('bogus_queue') doesn't actually do anything.
And, there's no delete! command.

Thanks in advance,
Jonathan

Re: Deleting Queues?

From:
Chris Wanstrath
Date:
2009-11-14 @ 00:06
On Fri, Nov 13, 2009 at 12:15 PM, Jonathan <jonathan@singlefeed.com> wrote:

> The answer to this question is probably right in-front of me,
> nevertheless I've spent a bit of time in the docs, and playing-around
> in script/console (i.e. w/ the list of Resque.methods), but I'm not
> finding it.
>
> Would someone please tell me how-to remove a queue?
>
> i.e. Resque.queues.delete('bogus_queue') doesn't actually do anything.
> And, there's no delete! command.

We've actually never had to do this, so there was no code for it. I've
just added this method and pushed it to git:

http://github.com/defunkt/resque/commit/68f7463ef95aa76b0fc37b24357111ffb0b24c94

For now you can do it manually:

    queue = 'bogus_queue'
    Resque.redis.srem(:queues, queue)
    Resque.redis.del("queue:#{queue}")

Cheers,

-- 
Chris Wanstrath
http://github.com/defunkt