There has error if insert more than one record into failed_jobs table
error message : duplicate key error collection: life_moments.failed_jobs index: uuid_1 dup key: { uuid: null }
Actual behaviour
Rewrite log method from MongoFailedJobProvider.php
add
public function log($connection, $queue, $payload, $exception)
{
$failed_at = Carbon::now()->getTimestamp();
$uuid = json_decode($payload, true)['uuid'];//add this ,because uuid is unique
$exception = (string) $exception;
$this->getTable()->insert(compact('uuid','connection', 'queue', 'payload', 'failed_at', 'exception'));
}
Description:
Steps to reproduce
1.add a job 2.throw exception in job 3.
Expected behaviour
There has error if insert more than one record into failed_jobs table error message : duplicate key error collection: life_moments.failed_jobs index: uuid_1 dup key: { uuid: null }
Actual behaviour
Rewrite log method from MongoFailedJobProvider.php add public function log($connection, $queue, $payload, $exception) { $failed_at = Carbon::now()->getTimestamp();
Logs:
Insert log.txt here (if necessary)