CStrategies
Member
We have a large database updating process that is run whenever a user takes certain actions. It was causing deadlocks when the site had a lot of activity, so we converted it to a job with a uniqueId, passed certain params that were unique to that user, and made sure manual was set to "false" so the job would run in the background.
There is some evidence that would suggest that when traffic is high, some of these jobs aren't actually being run, or maybe they're being dropped. It's difficult to diagnose without really understanding how the job system works, which seems to be thinly explained in the developer docs.
Code:
The way I think it works is that the job manager will see if there is already an
What I hope is not happening but I suspect may be the case: the job manager sees
I thought about not using
There is some evidence that would suggest that when traffic is high, some of these jobs aren't actually being run, or maybe they're being dropped. It's difficult to diagnose without really understanding how the job system works, which seems to be thinly explained in the developer docs.
Code:
Code:
$jobManager->enqueueUnique('updateJobUniqueId', 'MyName\MyAddon\Job\MyJobClass', [
'thisUserData' => $thisUserData
], false);
The way I think it works is that the job manager will see if there is already an
updateJobUniqueId
job running, and if so, it will queue this next instance of the job to start when the current one ends. What I hope is not happening but I suspect may be the case: the job manager sees
updateJobUniqueId
is already running, so it does not run the new job at all. I thought about not using
enqueueUnique
but then I'm back to the deadlock issue, defeating the purpose.