Skip to content

Commit 4044bd2

Browse files
vaendabackportbot[bot]
authored andcommitted
fix(jobs): don't overwrite the --stop_after baseline in background-job:worker
$startTime was used for two different things: as baseline for --stop_after and as start time of the currently running job. The variable was reassigned during each loop with each new job in the queue, so the baseline for --stop_after was lost and the worker never terminated. Renaming the job variable fixes this issue. Assisted-by: Claude:claude-opus-5 Signed-off-by: Sven Hansen <vaenda@vaenda.de>
1 parent 41e10e2 commit 4044bd2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

core/Command/Background/JobWorker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
139139
memory_reset_peak_usage();
140140
$jobClassId = $this->jobClassesRegistry->getId($jobClassName);
141141
$jobRunId = $this->jobRuns->started($jobClassId);
142-
$startTime = microtime(true);
142+
$jobStartTime = microtime(true);
143143
$job->start($this->jobList);
144-
$timeSpent = microtime(true) - $startTime;
144+
$timeSpent = microtime(true) - $jobStartTime;
145145
$jobMemoryPeak = memory_get_peak_usage();
146146
// TODO Job failure will never be catched here because exceptions are catched within $job->start method
147147
// The error will only be visible in server logs.

0 commit comments

Comments
 (0)