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

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMax <max@nextcloud.com>2022-03-07 11:22:14 +0300
committernextcloud-command <nextcloud-command@users.noreply.github.com>2022-03-09 08:23:18 +0300
commitfd6395128cfb4ddc2aa28b1587903202eecdc16a (patch)
tree20f80cd5da2ab19ee76f6bf503634b054c27e580 /lib
parent44737f20095f30ef2440f8667a21e21decf9d648 (diff)
performance: fetch content during session creation
Signed-off-by: Max <max@nextcloud.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Service/ApiService.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php
index 7207e7250..1ef829466 100644
--- a/lib/Service/ApiService.php
+++ b/lib/Service/ApiService.php
@@ -106,10 +106,18 @@ class ApiService {
}
$session = $this->sessionService->initSession($document->getId(), $guestName);
+ try {
+ $baseFile = $this->documentService->getBaseFile($document->getId());
+ $content = $baseFile->getContent();
+ } catch (NotFoundException $e) {
+ $this->logger->logException($e, ['level' => ILogger::INFO]);
+ $content = null;
+ }
return new DataResponse([
'document' => $document,
'session' => $session,
- 'readOnly' => $readOnly
+ 'readOnly' => $readOnly,
+ 'content' => $content
]);
}