XF 2.0 How to stop running job?

CMTV

Well-known member
In my code I create a new job with this code:
PHP:
\XF::app()->jobManager()->enqueueUnique('solvedAlerting_' . time(), 'QuestionThreads:Alerter', $jobParams);
How can I stop the job by it's key programmatically?

I know that all currently running jobs are stored in xf_job table. And deleding records form there do stop the job. But is this the correct way to stop it?
 
Last edited:

Mike

XenForo developer
Staff member
The cancelUniqueJob() method in the job manager will do what you want.
 
Top