diff --git a/apps/federation/lib/BackgroundJob/GetSharedSecret.php b/apps/federation/lib/BackgroundJob/GetSharedSecret.php index fdfa24fb5669f..089a335aae31e 100644 --- a/apps/federation/lib/BackgroundJob/GetSharedSecret.php +++ b/apps/federation/lib/BackgroundJob/GetSharedSecret.php @@ -74,6 +74,10 @@ protected function parentStart(IJobList $jobList): void { #[\Override] protected function run($argument) { + // The DI container caches this instance, so a prior invocation in the + // same cron pass can leave $retainJob = true and cause this row to be + // re-queued unconditionally after start() removes it. + $this->retainJob = false; $target = $argument['url']; $created = isset($argument['created']) ? (int)$argument['created'] : $this->time->getTime(); $currentTime = $this->time->getTime(); diff --git a/apps/federation/lib/BackgroundJob/RequestSharedSecret.php b/apps/federation/lib/BackgroundJob/RequestSharedSecret.php index 3818f9e14627c..4353bb64b6dec 100644 --- a/apps/federation/lib/BackgroundJob/RequestSharedSecret.php +++ b/apps/federation/lib/BackgroundJob/RequestSharedSecret.php @@ -87,6 +87,10 @@ protected function parentStart(IJobList $jobList): void { */ #[\Override] protected function run($argument) { + // The DI container caches this instance, so a prior invocation in the + // same cron pass can leave $retainJob = true and cause this row to be + // re-queued unconditionally after start() removes it. + $this->retainJob = false; $target = $argument['url']; $created = isset($argument['created']) ? (int)$argument['created'] : $this->time->getTime(); $currentTime = $this->time->getTime();