refactor/perf(backend): provide metadata statically (#14601)

* wip

* Update ReactionService.ts

* Update ApiCallService.ts

* Update timeline.ts

* Update GlobalModule.ts

* Update GlobalModule.ts

* Update NoteEntityService.ts

* wip

* wip

* wip

* Update ApPersonService.ts

* wip

* Update GlobalModule.ts

* Update mock-resolver.ts

* Update RoleService.ts

* Update activitypub.ts

* Update activitypub.ts

* Update activitypub.ts

* Update activitypub.ts

* Update activitypub.ts

* clean up

* Update utils.ts

* Update UtilityService.ts

* Revert "Update utils.ts"

This reverts commit a27d4be764b78c1b5a9eac685e261fee49331d89.

* Revert "Update UtilityService.ts"

This reverts commit e5fd9e004c482cf099252201c0c1aa888e001430.

* vuwa-

* Revert "vuwa-"

This reverts commit 0c3bd12472b4b9938cdff2d6f131e6800bc3724c.

* Update entry.ts

* Update entry.ts

* Update entry.ts

* Update entry.ts

* Update jest.setup.ts
This commit is contained in:
syuilo 2024-09-22 12:53:13 +09:00 committed by GitHub
parent 3ad5c753fa
commit 023fa30280
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
55 changed files with 499 additions and 487 deletions

View file

@ -5,9 +5,10 @@
import * as os from 'node:os';
import si from 'systeminformation';
import { Injectable } from '@nestjs/common';
import { Inject, Injectable } from '@nestjs/common';
import { Endpoint } from '@/server/api/endpoint-base.js';
import { MetaService } from '@/core/MetaService.js';
import { MiMeta } from '@/models/_.js';
import { DI } from '@/di-symbols.js';
export const meta = {
requireCredential: false,
@ -73,10 +74,11 @@ export const paramDef = {
@Injectable()
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export
constructor(
private metaService: MetaService,
@Inject(DI.meta)
private serverSettings: MiMeta,
) {
super(meta, paramDef, async () => {
if (!(await this.metaService.fetch()).enableServerMachineStats) return {
if (!this.serverSettings.enableServerMachineStats) return {
machine: '?',
cpu: {
model: '?',