Canceling job

15 views
Skip to first unread message

AssimovT

unread,
Oct 28, 2009, 2:45:20 AM10/28/09
to delayed_job
Hiya.

Does anyone know how to cancel the delayed job? I have CSV importing/
processing in background, which checks a flag in database if user
canceled the operation, however seems it does not help. What am I
doing wrong? Does delayed job check the db changes after taking the
job into queue?

Please help.

Thanks.

Tair.

David Genord II

unread,
Oct 28, 2009, 8:36:52 AM10/28/09
to delay...@googlegroups.com
How and where are you performing this check?
David Genord II

AssimovT

unread,
Oct 28, 2009, 12:31:45 PM10/28/09
to delayed_job
hi, David.

I am performing the check in the model method i m triggering form the
delayed "perform". i have a model boolean which is checked in the
importing operation in background, and if its true, I m ending the
loop.

Is it something that should have worked?

thanks,

Tair

On Oct 28, 4:36 pm, David Genord II <albus...@gmail.com> wrote:
> How and where are you performing this check?
> David Genord II
>

David Genord II

unread,
Oct 28, 2009, 2:11:50 PM10/28/09
to delay...@googlegroups.com
So if I understand you correctly you have a method within an ActiveRecord model that you are telling delayed job to run later. Within this method you have a loop inside which you tell the loop to break if canceled is set true. Do you reload the model at any point in this loop, because this loop is out of the scope of Delayed Job and therefore the model is never changed or reloaded by Delayed Job.
David Genord II
Reply all
Reply to author
Forward
0 new messages