From c5ec9cbeee78f5cbb852b605e4241f72af3bb0bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 15 Apr 2024 21:51:24 +0200 Subject: [PATCH] fix: Only update lock timeout when it is not infinite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Service/LockService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/LockService.php b/lib/Service/LockService.php index bc6bf543..c443e26c 100644 --- a/lib/Service/LockService.php +++ b/lib/Service/LockService.php @@ -169,7 +169,7 @@ public function lock(LockContext $lockScope): FileLock { $known->getType() === $lockScope->getType() && ($known->getOwner() === $lockScope->getOwner() || $known->getToken() === $lockScope->getOwner()) ) { $known->setTimeout( - $known->getTimeout() - $known->getETA() + $this->configService->getTimeoutSeconds() + $known->getETA() !== FileLock::ETA_INFINITE ? $known->getTimeout() - $known->getETA() + $this->configService->getTimeoutSeconds() : 0 ); $this->notice('extending existing lock', false, ['fileLock' => $known]); $this->locksRequest->update($known);