-
-
Notifications
You must be signed in to change notification settings - Fork 34
Update DefaultWorkflowState.php #107
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
base: master
Are you sure you want to change the base?
Conversation
Hello, @ksassnowski @stevebauman, Can you please merge this if it's ok? Thank you for this package. |
the fix fixes when there is like 10 jobs, but when I increased it to 50 jobs, there is this issue PDOException
/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php in PDO::beginTransaction
There is already an active transaction I have tried retry(3, function() {
DB::transaction(function () use ($job): void {
/** @var Workflow $workflow */
$workflow = $this->workflow
->newQuery()
->lockForUpdate()
->findOrFail($this->workflow->getKey(), ['finished_jobs', 'jobs_processed']);
$this->workflow->update([
'finished_jobs' => \array_merge(
$workflow->finished_jobs,
[$job->getJobId()],
),
'jobs_processed' => $workflow->jobs_processed + 1,
]);
$job->step()?->markAsFinished();
}, 5);
}, 250); still having the same issue. I'm not sure what to do. This is the workflow model (6 jobs are finished but not recorded)
|
Kindly see the latest changes. Redis::funnel fixes it, but I'm unsure if depending on redis is the right way. |
I have an issue where a workflow is failing because many jobs are finishing at the same time (around 10 jobs), causing a deadlock exception.
This should fix it