From 3679cb7f7d35716f5309fd46fd26541009e7ee91 Mon Sep 17 00:00:00 2001 From: Jake Bentvelzen Date: Fri, 3 Feb 2017 11:40:55 +1100 Subject: [PATCH] FIX Ensure QueuedJob health check doesn't kill long running review jobs --- code/jobs/ContentReviewNotificationJob.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/jobs/ContentReviewNotificationJob.php b/code/jobs/ContentReviewNotificationJob.php index c884b0c..2d8546e 100644 --- a/code/jobs/ContentReviewNotificationJob.php +++ b/code/jobs/ContentReviewNotificationJob.php @@ -71,6 +71,14 @@ class ContentReviewNotificationJob extends AbstractQueuedJob implements QueuedJo return QueuedJob::QUEUED; } + public function setup() { + parent::setup(); + + // Recommended for long running jobs that don't increment 'currentStep' + // https://github.com/silverstripe-australia/silverstripe-queuedjobs + $this->currentStep = -1; + } + public function process() { $this->queueNextRun();