From c6376a395e14fffa8d3971719a7027eae37021ba Mon Sep 17 00:00:00 2001 From: riku6460 <17585784+riku6460@users.noreply.github.com> Date: Thu, 7 Mar 2024 23:44:41 +0900 Subject: [PATCH] =?UTF-8?q?/=5Finfo=5Fcard=5F=20=E3=81=AE=E3=83=A6?= =?UTF-8?q?=E3=83=BC=E3=82=B6=E3=83=BC=E6=95=B0=E3=83=BB=E3=83=8E=E3=83=BC?= =?UTF-8?q?=E3=83=88=E6=95=B0=E3=81=AE=E3=82=AF=E3=82=A8=E3=83=AA=E3=82=92?= =?UTF-8?q?=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5=E3=81=99=E3=82=8B?= =?UTF-8?q?=20(#514)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/server/web/ClientServerService.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts index 43a93cf148..c39eb2fb47 100644 --- a/packages/backend/src/server/web/ClientServerService.ts +++ b/packages/backend/src/server/web/ClientServerService.ts @@ -776,12 +776,17 @@ export class ClientServerService { reply.removeHeader('X-Frame-Options'); + const [originalUsersCount, originalNotesCount] = await Promise.all([ + this.usersRepository.count({ where: { host: IsNull() }, cache: 1000 * 60 * 60 * 6 }), // 6 hours + this.notesRepository.count({ where: { userHost: IsNull() }, cache: 1000 * 60 * 60 * 6 }), // 6 hours + ]); + return await reply.view('info-card', { version: this.config.version, host: this.config.host, meta: meta, - originalUsersCount: await this.usersRepository.countBy({ host: IsNull() }), - originalNotesCount: await this.notesRepository.countBy({ userHost: IsNull() }), + originalUsersCount, + originalNotesCount, }); });