From 06556b4ff4006778a6cfd20947cceadc208eec90 Mon Sep 17 00:00:00 2001 From: Benjamin Frueh Date: Tue, 10 Mar 2026 21:24:23 +0100 Subject: [PATCH] fix: do not expire locks when no timeout is configured, use -1 for infinite locks Signed-off-by: Benjamin Frueh --- lib/Service/ConfigService.php | 2 +- lib/Service/LockService.php | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php index a7b6a286..3199134f 100644 --- a/lib/Service/ConfigService.php +++ b/lib/Service/ConfigService.php @@ -17,7 +17,7 @@ class ConfigService { public const LOCK_TIMEOUT = 'lock_timeout'; public $defaults = [ - self::LOCK_TIMEOUT => '0' + self::LOCK_TIMEOUT => '-1' ]; /** @var string */ diff --git a/lib/Service/LockService.php b/lib/Service/LockService.php index 1858c8ca..ecf65728 100644 --- a/lib/Service/LockService.php +++ b/lib/Service/LockService.php @@ -298,11 +298,9 @@ public function unlockFile(int $fileId, string $userId, bool $force = false, int */ public function getDeprecatedLocks(int $limit = 0): array { $timeout = (int)$this->configService->getAppValue(ConfigService::LOCK_TIMEOUT); - if ($timeout === 0) { - $this->logger->notice( - 'ConfigService::LOCK_TIMEOUT is not numerical, using default', ['current' => $timeout, 'exception' => new \Exception()] - ); - $timeout = (int)$this->configService->defaults[ConfigService::LOCK_TIMEOUT]; + + if ($timeout === FileLock::ETA_INFINITE) { + return []; } try {