Closed
Description
- Laravel-mongodb Version: 3.8.3
- Laravel-framework: 8.34.0
- PHP Version: 7.3.26
- Database Driver & Version:
Description:
Steps to reproduce
- Create & dispatch a Job using MongoDB as queue driver
- Call $this->release() in the job
- Exception: job->release() leads to "Call to a member function beginTransaction() on null" error
Expected behaviour
Job should be pushed back onto the queue with count of attempts += 1
Actual behaviour
Exception: Call to a member function beginTransaction() on null
Cause
In Laravel 8 the Illuminate\Queue\DatabaseQueue class was updated with changed functionality. Instead of calling $database->release() it nows calls a new method $database->deleteAndRelease() which wraps the delete & release operations into a transaction, I'll try to add a PR later which fixes this in Jenssegers\Mongodb\Queue\MongoQueue by adding an overwrite (like it is already done for deleteReserved() and pop() methods of the DatabaseQueue):
public function deleteAndRelease($queue, $job, $delay)
{
$this->deleteReserved($queue, $job->getJobId());
$this->release($queue, $job->getJobRecord(), $delay);
}
Logs:
Insert log.txt here (if necessary)Metadata
Metadata
Assignees
Labels
No labels