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 a27d4be764.

* Revert "Update UtilityService.ts"

This reverts commit e5fd9e004c.

* vuwa-

* Revert "vuwa-"

This reverts commit 0c3bd12472.

* 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
55 changed files with 499 additions and 487 deletions

View File

@@ -10,7 +10,6 @@ import type { Packed } from '@/misc/json-schema.js';
import type { MiMeta } from '@/models/Meta.js';
import type { AdsRepository } from '@/models/_.js';
import { MAX_NOTE_TEXT_LENGTH } from '@/const.js';
import { MetaService } from '@/core/MetaService.js';
import { bindThis } from '@/decorators.js';
import { UserEntityService } from '@/core/entities/UserEntityService.js';
import { InstanceActorService } from '@/core/InstanceActorService.js';
@@ -24,11 +23,13 @@ export class MetaEntityService {
@Inject(DI.config)
private config: Config,
@Inject(DI.meta)
private meta: MiMeta,
@Inject(DI.adsRepository)
private adsRepository: AdsRepository,
private userEntityService: UserEntityService,
private metaService: MetaService,
private instanceActorService: InstanceActorService,
) { }
@@ -37,7 +38,7 @@ export class MetaEntityService {
let instance = meta;
if (!instance) {
instance = await this.metaService.fetch();
instance = this.meta;
}
const ads = await this.adsRepository.createQueryBuilder('ads')
@@ -140,7 +141,7 @@ export class MetaEntityService {
let instance = meta;
if (!instance) {
instance = await this.metaService.fetch();
instance = this.meta;
}
const packed = await this.pack(instance);