diff --git a/src/Illuminate/Queue/DatabaseQueue.php b/src/Illuminate/Queue/DatabaseQueue.php index 6a052a349b92..6aef0a17b2af 100644 --- a/src/Illuminate/Queue/DatabaseQueue.php +++ b/src/Illuminate/Queue/DatabaseQueue.php @@ -253,7 +253,13 @@ protected function markJobAsReserved($id) */ public function deleteReserved($queue, $id) { - $this->database->table($this->table)->where('id', $id)->delete(); + $this->database->beginTransaction(); + + if ($this->database->table($this->table)->lockForUpdate()->find($id)) { + $this->database->table($this->table)->where('id', $id)->delete(); + } + + $this->database->commit(); } /**