From 97c8dcea0a0f04fed0a75c3f6dd7a26c568e8322 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Tue, 25 Aug 2015 18:03:13 +1200 Subject: [PATCH] BUG fix merge regressions from https://github.com/silverstripe-australia/silverstripe-queuedjobs/pull/49/ --- code/services/QueuedJobService.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/services/QueuedJobService.php b/code/services/QueuedJobService.php index deb15417..108fcfb8 100644 --- a/code/services/QueuedJobService.php +++ b/code/services/QueuedJobService.php @@ -120,7 +120,10 @@ public function queueJob(QueuedJob $job, $startAfter = null, $userId = null, $qu // see if we already have this job in a queue $filter = array( 'Signature' => $signature, - 'JobStatus' => QueuedJob::STATUS_NEW, + 'JobStatus' => array( + QueuedJob::STATUS_NEW, + QueuedJob::STATUS_INIT + ) ); $existing = DataList::create('QueuedJobDescriptor')->filter($filter)->first(); @@ -402,7 +405,7 @@ protected function grabMutex(QueuedJobDescriptor $jobDescriptor) { return false; } - if(DB::getConn()->affectedRows() === 0) { + if(DB::getConn()->affectedRows() === 0 && $jobDescriptor->JobStatus !== QueuedJob::STATUS_INIT) { return false; }