Skip to content

Commit

Permalink
Merge branch '4' into 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Dec 19, 2023
2 parents ba75e28 + b03a83a commit 5bd3eeb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Services/QueuedJobService.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,8 @@ protected function grabMutex(QueuedJobDescriptor $jobDescriptor)
try {
// Start a transaction which will hold until we have a lock on this descriptor.
DB::get_conn()->withTransaction(function () use ($descriptorId) {
$query = 'SELECT "ID" FROM "QueuedJobDescriptor" WHERE "ID" = %s AND "Worker" IS NULL FOR UPDATE';
$forUpdate = DB::getConfig()['type'] == 'SQLite3Database' ? '' : ' FOR UPDATE';
$query = 'SELECT "ID" FROM "QueuedJobDescriptor" WHERE "ID" = %s AND "Worker" IS NULL' . $forUpdate;

$row = DB::query(sprintf($query, Convert::raw2sql($descriptorId)))->record();

Expand Down

0 comments on commit 5bd3eeb

Please sign in to comment.