Skip to content

Commit

Permalink
Merge pull request #290 from nextcloud/backport/288/stable28
Browse files Browse the repository at this point in the history
[stable28] fix: Only update lock timeout when it is not infinite
  • Loading branch information
max-nextcloud authored Apr 16, 2024
2 parents 34a11b4 + 7366f54 commit f014114
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
Expand Up @@ -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);
Expand Down

0 comments on commit f014114

Please sign in to comment.