Skip to content

Commit 8f82507

Browse files
committed
BUGFIX: Cancel specified job instead of all others
1 parent 150a504 commit 8f82507

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

Classes/ContentReleaseManager.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function startFullContentRelease(bool $validate = true, string $currentCo
8484
return $contentReleaseId;
8585
}
8686

87-
public function cancelAllRunningContentReleases()
87+
public function cancelAllRunningContentReleases(): void
8888
{
8989
$result = $this->prunnerApiService->loadPipelinesAndJobs();
9090
$runningJobs = $result->getJobs()->forPipeline(PipelineName::create('do_content_release'))->running();
@@ -93,19 +93,22 @@ public function cancelAllRunningContentReleases()
9393
}
9494
}
9595

96-
public function cancelRunningContentReleases(JobId $jobId): void
96+
/**
97+
* Cancel a single running content release ignoring all others
98+
*/
99+
public function cancelRunningContentRelease(JobId $jobId): void
97100
{
98101
$result = $this->prunnerApiService->loadPipelinesAndJobs();
99102
$runningJobs = $result->getJobs()->forPipeline(PipelineName::create('do_content_release'))->running();
100103
foreach ($runningJobs as $job) {
101-
if ($job->getId() !== $jobId) {
104+
if ($job->getId() === $jobId) {
102105
$this->prunnerApiService->cancelJob($job);
103106
break;
104107
}
105108
}
106109
}
107110

108-
public function toggleConfigEpoch(RedisInstanceIdentifier $redisInstanceIdentifier)
111+
public function toggleConfigEpoch(RedisInstanceIdentifier $redisInstanceIdentifier): void
109112
{
110113
$currentConfigEpochConfig = $this->configEpochSettings['current'] ?? null;
111114
$previousConfigEpochConfig = $this->configEpochSettings['previous'] ?? null;

0 commit comments

Comments
 (0)