Skip to content

Commit 576f057

Browse files
committed
Changed: Clear Doctrine cache before calculate Root Job Status
Before determine Root Job Status Doctrine cache for Job entity must be cleared, otherwise if this root job was processed in previous request by the same enqueue, then it will falsely return old status, which will cause infinite running root jobs
1 parent 2e5c41c commit 576f057

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pkg/job-queue/CalculateRootJobStatusProcessor.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public function __construct(
4848

4949
public function process(Message $message, Context $context)
5050
{
51+
$this->jobStorage->clearJobCache();
5152
$data = JSON::decode($message->getBody());
5253

5354
if (!isset($data['jobId'])) {

pkg/job-queue/Doctrine/JobStorage.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ public function saveJob(Job $job, \Closure $lockCallback = null)
179179
}
180180
}
181181

182+
public function clearJobCache()
183+
{
184+
$this->getEntityManager()->clear($this->entityClass);
185+
}
186+
182187
/**
183188
* @return EntityRepository
184189
*/

0 commit comments

Comments
 (0)