librelist archives

« back to archive

Problem with dequeue & kill workers

Problem with dequeue & kill workers

From:
Marian Mrózek
Date:
2011-06-15 @ 14:18
Hello,

when I add job to queue:

Resque.enqueue(Jobs::UnpackFile, { :job_id => new_job.id, :foo => :bar
... })

everythink is OK, but when I want remove jobs with "job_id" from this queue:

Resque.dequeue(Jobs::UnpackFile { :job_id => job.id})

jobs not remove :(

----

and this code workers not killed :(

all_workers = Resque.workers
all_workers.each do |worker|
    worker.shutdown!
end

workers get started:

COUNT=3 QUEUE=* rake resque:workers

Thx

Marian

Re: [resque] Problem with dequeue & kill workers

From:
Chris Wanstrath
Date:
2011-06-17 @ 11:46
On Wed, Jun 15, 2011 at 4:18 PM, Marian Mrózek <mrozek.marian@gmail.com> wrote:
> when I add job to queue:
>
> Resque.enqueue(Jobs::UnpackFile, { :job_id => new_job.id, :foo => :bar
> ... })
>
> everythink is OK, but when I want remove jobs with "job_id" from this queue:
>
> Resque.dequeue(Jobs::UnpackFile { :job_id => job.id})
>
> jobs not remove :(

Unfortunately `dequeue` needs to be passed the exact same args as
`enqueue` -- e.g. the `:foo => :bar`

Re: [resque] Problem with dequeue & kill workers

From:
Marian Mrózek
Date:
2011-06-17 @ 14:48

Dne 17.6.2011 13:46, Chris Wanstrath napsal(a):
> On Wed, Jun 15, 2011 at 4:18 PM, Marian Mrózek <mrozek.marian@gmail.com> wrote:
>> when I add job to queue:
>>
>> Resque.enqueue(Jobs::UnpackFile, { :job_id => new_job.id, :foo => :bar
>> ... })
>>
>> everythink is OK, but when I want remove jobs with "job_id" from this queue:
>>
>> Resque.dequeue(Jobs::UnpackFile { :job_id => job.id})
>>
>> jobs not remove :(
> Unfortunately `dequeue` needs to be passed the exact same args as
> `enqueue` -- e.g. the `:foo => :bar`

Is some another solution, when I know only job_id and other args no?

Re: [resque] Problem with dequeue & kill workers

From:
Chris Wanstrath
Date:
2011-06-20 @ 09:43
On Fri, Jun 17, 2011 at 4:48 PM, Marian Mrózek <mrozek.marian@gmail.com> wrote:

> Is some another solution, when I know only job_id and other args no?

Not with stock Resque, sorry.

Re: [resque] Problem with dequeue & kill workers

From:
David Balatero
Date:
2011-06-15 @ 15:01
Did you mean to leave out the argument comma in:
Resque.dequeue(Jobs::UnpackFile { :job_id => job.id})?

Re: [resque] Problem with dequeue & kill workers

From:
Marian Mrózek
Date:
2011-06-15 @ 18:13
Yes, I want remove all jobs from queue with argument job.id, but jobs
not remove. Can you help me please?

Dne 15.6.2011 17:01, David Balatero napsal(a):
> Did you mean to leave out the argument comma in:
> Resque.dequeue(Jobs::UnpackFile { :job_id => job.id <http://job.id/>})?