jmettraux/rufus-scheduler — Issue #27: Cannot stop a running job
Author: mareczek
Created: 2012-01-11 14:56:01+00:00
State: open

Hello,
Thanks for a wonderful gem! I have a small problem with stopping a running job. Once the job disappears from:
scheduler.jobs
it goes to:
scheduler.running_jobs

i find the job by simply:
scheduler.running_jobs.select { |job| job.job_id == saved_in_database_job_id }
because, this doesn't work:
scheduler.find(saved_in_database_job_id)

The question is: how can i pause / resume / stop a job that is already running.
Example:
I'm sending 10000 emails in one loop to is run as a job scheduled in Rufus Scheduler. I noticed that i'm sending bad content and i want to stop it by using a button on my webpage. So, i'm retrieving the job by using:
@@scheduler.running_jobs.select { |job| job.job_id == saved_in_database_job_id }
What do i do next? How do i stop the running job?

Thank you for any advice! :-)