restore activeHalfYear and activeMonth
All checks were successful
Lint / pnpm_install (push) Successful in 1m39s
Publish Docker image / Build (push) Successful in 5m0s
Test (production install and build) / production (20.16.0) (push) Successful in 1m12s
Test (backend) / unit (20.16.0) (push) Successful in 7m4s
Lint / lint (backend) (push) Successful in 2m25s
Lint / lint (frontend) (push) Successful in 2m9s
Lint / lint (frontend-embed) (push) Successful in 2m17s
Test (backend) / e2e (20.16.0) (push) Successful in 10m49s
Lint / lint (frontend-shared) (push) Successful in 2m30s
Lint / lint (misskey-bubble-game) (push) Successful in 2m20s
Lint / lint (misskey-js) (push) Successful in 2m26s
Lint / lint (misskey-reversi) (push) Successful in 2m25s
Lint / lint (sw) (push) Successful in 2m23s
Lint / typecheck (misskey-js) (push) Successful in 1m29s
Lint / typecheck (backend) (push) Successful in 2m20s
Lint / typecheck (sw) (push) Successful in 1m47s
Lint / pnpm_install (pull_request) Successful in 1m40s
Publish Docker image / Build (pull_request) Successful in 4m59s
Test (production install and build) / production (20.16.0) (pull_request) Successful in 1m10s
Test (backend) / unit (20.16.0) (pull_request) Successful in 7m8s
Test (backend) / e2e (20.16.0) (pull_request) Successful in 11m6s
Lint / lint (backend) (pull_request) Successful in 2m4s
Lint / lint (frontend) (pull_request) Successful in 2m15s
Lint / lint (frontend-embed) (pull_request) Successful in 2m7s
Lint / lint (frontend-shared) (pull_request) Successful in 2m13s
Lint / lint (misskey-bubble-game) (pull_request) Successful in 2m8s
Lint / lint (misskey-js) (pull_request) Successful in 2m7s
Lint / lint (misskey-reversi) (pull_request) Successful in 2m11s
Lint / lint (sw) (pull_request) Successful in 2m28s
Lint / typecheck (backend) (pull_request) Successful in 2m19s
Lint / typecheck (misskey-js) (pull_request) Successful in 1m30s
Lint / typecheck (sw) (pull_request) Successful in 1m40s

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
This commit is contained in:
ゆめ 2024-11-10 02:40:32 -06:00
parent 94ce0fd414
commit 18a27e3c47
No known key found for this signature in database

View file

@ -15,6 +15,8 @@ import NotesChart from '@/core/chart/charts/notes.js';
import UsersChart from '@/core/chart/charts/users.js';
import { DEFAULT_POLICIES } from '@/core/RoleService.js';
import type { FastifyInstance, FastifyPluginOptions } from 'fastify';
import { IsNull, MoreThan } from 'typeorm';
import type { UsersRepository } from '@/models/_.js';
const nodeinfo2_1path = '/nodeinfo/2.1';
const nodeinfo2_0path = '/nodeinfo/2.0';
@ -25,6 +27,8 @@ export class NodeinfoServerService {
constructor(
@Inject(DI.config)
private config: Config,
@Inject(DI.usersRepository)
private usersRepository: UsersRepository,
private userEntityService: UserEntityService,
private metaService: MetaService,
@ -58,18 +62,14 @@ 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 proxyAccount = meta.proxyAccountId ? await this.userEntityService.pack(meta.proxyAccountId).catch(() => null) : null;
const basePolicies = { ...DEFAULT_POLICIES, ...meta.policies };