fix(server): DriveFile related N+1 query when call note packMany (again) (#10190)
* Revert "Revert "fix(server): DriveFile related N+1 query when call note packMany (#10133)""
This reverts commit a7c82eeabc
.
* packManyByIdsMap: 存在チェックをしてなかったものは null を入れるように
* Note.packMany で reply とか renote がもうあったらそのファイルも引く
* テストを書く
* fix test
* fix test
* fix test
* fix test
This commit is contained in:
parent
e4fc9ea816
commit
49f0837729
4 changed files with 168 additions and 5 deletions
|
@ -41,7 +41,8 @@ export class GalleryPostEntityService {
|
|||
title: post.title,
|
||||
description: post.description,
|
||||
fileIds: post.fileIds,
|
||||
files: this.driveFileEntityService.packMany(post.fileIds),
|
||||
// TODO: packMany causes N+1 queries
|
||||
files: this.driveFileEntityService.packManyByIds(post.fileIds),
|
||||
tags: post.tags.length > 0 ? post.tags : undefined,
|
||||
isSensitive: post.isSensitive,
|
||||
likedCount: post.likedCount,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue