So I have
MyJob.perform_in(60, @user),
Which will perform my job in 60 seconds.
I want to cancel this Job if this line of code is ran again replacing it in the queue.
I have had no luck researching.
So I have
MyJob.perform_in(60, @user),
Which will perform my job in 60 seconds.
I want to cancel this Job if this line of code is ran again replacing it in the queue.
I have had no luck researching.
On
There is no built-in method inside of the SuckerPunch framework, that I can see from the source code, of canceling a single queued up job or a job that is currently executing. It appears that clearing the job queue is an all or nothing function.
That said, it should be a trivial matter to add an extension method that queries the underlying ConcurrentTask framework and matches up your new job with an already queued job based on the value of the @user parameter.
To get the stats related to SuckerPunch jobs
And To Clear the previous jobs
Hope this is useful !