Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempts not working as expected #20

Open
hi-rad opened this issue Aug 18, 2019 · 4 comments · May be fixed by #25
Open

attempts not working as expected #20

hi-rad opened this issue Aug 18, 2019 · 4 comments · May be fixed by #25
Labels

Comments

@hi-rad
Copy link

hi-rad commented Aug 18, 2019

When using php artisan queue:work --sleep=3 --tries=3 the attempts attribute will not be updated so the job will be retried for an infinite amount of time. If we set --tries to 1, the job will be processed once

How should we fix this?

@petermein
Copy link
Collaborator

Normally the attempt is stored in the job object itself. This is a problem in kafka, because the jobs are immutable. We can store an attempt elsewhere for example a cache.
But using kafka where the queue is persistent we should be able to complete all jobs without failing.

@petermein petermein added the bug label Oct 16, 2019
@hi-rad
Copy link
Author

hi-rad commented Oct 20, 2019

@petermein I checked the RabbitMQ library for Laravel and I found a solution to fix this. Since this library is based on the RabbitMQ, using the same solution fixes the issue (I changed the code and fixed the bug in my own project)

@petermein
Copy link
Collaborator

@hi-rad Great! Would you be able the share the fix with us?

@hi-rad hi-rad linked a pull request Nov 23, 2019 that will close this issue
@hi-rad
Copy link
Author

hi-rad commented Nov 23, 2019

@petermein I opened a pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants