Skip to content

Commit

Permalink
Merge pull request #60 from tractorcow/pulls/fix-all-the-things
Browse files Browse the repository at this point in the history
BUG fix merge regressions from #49
  • Loading branch information
assertchris committed Aug 25, 2015
2 parents 20dc536 + 97c8dce commit 52c081c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions code/services/QueuedJobService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 52c081c

Please sign in to comment.