Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ONLYOFFICE/onlyoffice-nextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntipkin-A <Artem.Antipkin@onlyoffice.com>2022-10-05 14:05:24 +0300
committerAntipkin-A <Artem.Antipkin@onlyoffice.com>2022-10-05 14:05:24 +0300
commit3a3117fe7eb2608757ecd9ed6b238f19e4792a1a (patch)
tree8f54e7d139f7ccdd1d17ab6e46c03b59bff9e8fd
parentffd746bd0d571622c85635bc3dd9f846e3ab8546 (diff)
don't lock if file is locked already
-rw-r--r--controller/callbackcontroller.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/controller/callbackcontroller.php b/controller/callbackcontroller.php
index 5496897..9ccb0a8 100644
--- a/controller/callbackcontroller.php
+++ b/controller/callbackcontroller.php
@@ -613,9 +613,11 @@ class CallbackController extends Controller {
case self::TrackerStatus_Editing:
try {
- $this->lockManager->lock(new LockContext($file, ILock::TYPE_APP, $this->appName));
+ if (empty($this->lockManager->getLocks($file->getId()))) {
+ $this->lockManager->lock(new LockContext($file, ILock::TYPE_APP, $this->appName));
- $this->logger->debug("$this->appName has locked file $fileId", ["app" => $this->appName]);
+ $this->logger->debug("$this->appName has locked file $fileId", ["app" => $this->appName]);
+ }
} catch (PreConditionNotMetException | OwnerLockedException | NoLockProviderException $e) {}
$result = 0;