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, }); });