diff --git a/packages/backend/src/server/NodeinfoServerService.ts b/packages/backend/src/server/NodeinfoServerService.ts index 6dee6ecd78..29d2edd76b 100644 --- a/packages/backend/src/server/NodeinfoServerService.ts +++ b/packages/backend/src/server/NodeinfoServerService.ts @@ -4,7 +4,9 @@ */ import { Inject, Injectable } from '@nestjs/common'; +import { IsNull, MoreThan } from 'typeorm'; import { DI } from '@/di-symbols.js'; +import type { UsersRepository } from '@/models/_.js'; import type { Config } from '@/config.js'; import { MetaService } from '@/core/MetaService.js'; import { MemorySingleCache } from '@/misc/cache.js'; @@ -25,6 +27,9 @@ export class NodeinfoServerService { @Inject(DI.config) private config: Config, + @Inject(DI.usersRepository) + private usersRepository: UsersRepository, + private userEntityService: UserEntityService, private metaService: MetaService, private notesChart: NotesChart, @@ -57,17 +62,17 @@ export class NodeinfoServerService { const [ meta, - //activeHalfyear, - //activeMonth, + activeHalfyear, + activeMonth, ] = await Promise.all([ this.metaService.fetch(true), // 重い - //this.usersRepository.count({ where: { host: IsNull(), lastActiveDate: MoreThan(new Date(now - 15552000000)) } }), - //this.usersRepository.count({ where: { host: IsNull(), lastActiveDate: MoreThan(new Date(now - 2592000000)) } }), + this.usersRepository.count({ where: { host: IsNull(), lastActiveDate: MoreThan(new Date(now - 15552000000)) } }), + this.usersRepository.count({ where: { host: IsNull(), lastActiveDate: MoreThan(new Date(now - 2592000000)) } }), ]); - const activeHalfyear = null; - const activeMonth = null; + // const activeHalfyear = null; + // const activeMonth = null; const proxyAccount = meta.proxyAccountId ? await this.userEntityService.pack(meta.proxyAccountId).catch(() => null) : null;