Restore activeHalfyear and activeMonth nodeinfo
With this content being cached by nginx, these queries shouldn't run
more than once every 15 minutes (or whatever your content cache is set
to), as far as I understand it. I have verified HIT/MISS via the
returned HTTP headers. Perhaps this is more of an issue on large
instances, but rather than this data just missing for all instances,
perhaps a control panel option could be added to enable/disable this?
Misskey nulled these stats as part of a performance issue:
https://github.com/misskey-dev/misskey/issues/9505 and committed changes
at c5cfbd99d0
This commit is contained in:
parent
fed5ff50b3
commit
43343d94a9
1 changed files with 11 additions and 6 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue