Skip to content

Commit

Permalink
Merge pull request #291 from nextcloud/backport/288/stable27
Browse files Browse the repository at this point in the history
[stable27] fix: Only update lock timeout when it is not infinite
  • Loading branch information
juliusknorr authored Apr 16, 2024
2 parents 7ded76d + 3957d76 commit 7c995ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Service/LockService.php
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 7c995ec

Please sign in to comment.