laravel-async-queue icon indicating copy to clipboard operation
laravel-async-queue copied to clipboard

Suggestion to resolve queue conflict

Open gsoareslima opened this issue 5 years ago • 0 comments

Hello, I identified a problem when using queue: listen/works processing the same queue where the async job is, the job ends up being processed multiple times or displays exception of multiple attempts.

My suggestion is to always add the prefix "sync." in the queue name. In class: \Barryvdh\Queue\AsyncQueue

protected function buildDatabaseRecord($queue, $payload, $availableAt, $attempts = 0) { $queue = 'async.'.($queue ?? 'default'); $record = parent::buildDatabaseRecord($queue, $payload, $availableAt, $attempts); $record['reserved_at'] = $this->currentTime(); return $record; }

gsoareslima avatar Aug 20 '20 20:08 gsoareslima