Skip to content

Commit 0ac5ab9

Browse files
committed
Perf: Optimize pages loading (simplify some code)
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
1 parent 6ddce0e commit 0ac5ab9

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

lib/Db/PageMapper.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ public function findByFileIds(array $fileIds, bool $trashed = false): array {
9090
}
9191

9292
$pagesByFileId = [];
93-
// Chunk fileIds to avoid Oracle's 1000 item limit in IN clauses
9493
foreach (array_chunk($fileIds, 1000) as $chunk) {
9594
$qb = $this->db->getQueryBuilder();
9695
$qb->select('*')

lib/Service/PageService.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -471,12 +471,7 @@ public function getPagesFromFolder(int $collectiveId, Folder $folder, string $us
471471
}
472472
}
473473
$pagesByFileId = $this->pageMapper->findByFileIds($pageFileIds);
474-
try {
475-
// The `page_id` column of `collectives_page_links` holds the file id (see NodeWrittenListener)
476-
$linkedPageIdsByFileId = $this->pageLinkMapper->findByPageIds($pageFileIds);
477-
} catch (DBException $e) {
478-
throw new NotFoundException($e->getMessage(), 0, $e);
479-
}
474+
$linkedPageIdsByFileId = $this->pageLinkMapper->findByPageIds($pageFileIds);
480475
$displayNames = [];
481476
foreach ($pagesByFileId as $page) {
482477
$lastUserId = $page->getLastUserId();

0 commit comments

Comments
 (0)