Skip to content

Commit 20bc4e7

Browse files
authored
Merge pull request #60714 from nextcloud/fix/F4-federation-retainjob-reset
fix(federation): reset retainJob at start of run()
2 parents 996fcfe + b4992b3 commit 20bc4e7

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

apps/federation/lib/BackgroundJob/GetSharedSecret.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ protected function parentStart(IJobList $jobList): void {
7575

7676
#[\Override]
7777
protected function run($argument) {
78+
// The DI container caches this instance, so a prior invocation in the
79+
// same cron pass can leave $retainJob = true and cause this row to be
80+
// re-queued unconditionally after start() removes it.
81+
$this->retainJob = false;
7882
$target = $argument['url'];
7983
$created = isset($argument['created']) ? (int)$argument['created'] : $this->time->getTime();
8084
$currentTime = $this->time->getTime();

apps/federation/lib/BackgroundJob/RequestSharedSecret.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ protected function parentStart(IJobList $jobList): void {
8787
*/
8888
#[\Override]
8989
protected function run($argument) {
90+
// The DI container caches this instance, so a prior invocation in the
91+
// same cron pass can leave $retainJob = true and cause this row to be
92+
// re-queued unconditionally after start() removes it.
93+
$this->retainJob = false;
9094
$target = $argument['url'];
9195
$created = isset($argument['created']) ? (int)$argument['created'] : $this->time->getTime();
9296
$currentTime = $this->time->getTime();

0 commit comments

Comments
 (0)