Skip to content
This repository was archived by the owner on Mar 9, 2024. It is now read-only.

Suggestion to resolve queue conflict #93

Open
gsoareslima opened this issue Aug 20, 2020 · 0 comments
Open

Suggestion to resolve queue conflict #93

gsoareslima opened this issue Aug 20, 2020 · 0 comments

Comments

@gsoareslima
Copy link

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;
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant