Skip to content

Commit

Permalink
Merge branch '4.1' into 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
robbieaverill committed May 27, 2019
2 parents a0fe9d0 + d0fb2e2 commit 317dba3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Services/QueuedJobService.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use SilverStripe\Control\Email\Email;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Convert;
use SilverStripe\Core\Extensible;
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\Core\Injector\Injector;
Expand Down Expand Up @@ -551,9 +550,12 @@ protected function grabMutex(QueuedJobDescriptor $jobDescriptor)
// and thus the row would always be affected.
try {
DB::query(sprintf(
'UPDATE "QueuedJobDescriptor" SET "JobStatus" = \'%s\' WHERE "ID" = %s',
'UPDATE "QueuedJobDescriptor" SET "JobStatus" = \'%s\' WHERE "ID" = %s'
. ' AND "JobFinished" IS NULL AND "JobStatus" NOT IN (%s)',
QueuedJob::STATUS_INIT,
$jobDescriptor->ID
$jobDescriptor->ID,
"'" . QueuedJob::STATUS_RUN . "', '" . QueuedJob::STATUS_COMPLETE . "', '"
. QueuedJob::STATUS_PAUSED . "', '" . QueuedJob::STATUS_CANCELLED . "'"
));
} catch (Exception $e) {
return false;
Expand Down

0 comments on commit 317dba3

Please sign in to comment.