Skip to content

Commit c4da15e

Browse files
committed
Changed: Refresh child entity when checking root job status
1 parent 576f057 commit c4da15e

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

pkg/job-queue/CalculateRootJobStatusProcessor.php

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

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

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

pkg/job-queue/CalculateRootJobStatusService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ protected function calculateRootJobStatus(array $jobs)
6969
$success = 0;
7070

7171
foreach ($jobs as $job) {
72+
$this->jobStorage->refreshedJobEntity($job);
7273
switch ($job->getStatus()) {
7374
case Job::STATUS_NEW:
7475
$new++;

pkg/job-queue/Doctrine/JobStorage.php

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

182-
public function clearJobCache()
182+
/**
183+
* @param Job $job
184+
*/
185+
public function refreshedJobEntity($job)
183186
{
184-
$this->getEntityManager()->clear($this->entityClass);
187+
$this->getEntityManager()->refresh($job);
185188
}
186189

187190
/**

0 commit comments

Comments
 (0)