I have an issue with one specific job, which is run on Azure with two attemps. At the end of the Job is created e-mail notification for all users (about 200 users, also through different Job). Problem is, that all users are getting same e-mail two times. I did a little research and found following. Assume, that Job is started at 9:12.
- 9:12 - 9:22 - Job - first attemp
- 9:22 - 9:31 - Job - second attemp
- 9:31 - Job table is filled with SendMail jobs from first attemp
- 9:31 - 9:36 - Emails from the first attemp starts to be sent (manual delay 3s between each one)
- 9:36 - 9:39 - Job table is clear
- 9:39 - Job table is filled with SendMail jobs from second attemp
- 9:39 - 9:44 - Emails from the second attemp starts to be sent (manual delay 3s between each one)
Here are listed some information about settings:
- Email sending is the last thing of whole job and emails are in both rounds sent succesfully to all users.
- Job listener task was set to artisan queue:work --timeout 600, so I though, it is 10 minutes issue between two attems.
- Job listener was changed to --timeout 1800, but still second attemp is fired after 10 minutes.
- Each job is set to max. 5 attemps
- on Azure listener job is running as continuous
- on local with exact db copy, job is beign finished on first attemp and only one round of emails is generated
- in job, log is made with request (caller of the job) information logged - log is created also two times, with exactly same content, just created_at is different (9:12 vs 9:22) but method call is in both of them at 9:12.
I found a workaround with Caching key after first round of e-mails is sent and disallow second loop if key exists, but I like to found the root of this issue. Do you have any suggestion?
question from:
https://stackoverflow.com/questions/65917180/azure-laravel-job-restarts-after-succesfully-ended 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…