Skip to content

Commit

Permalink
Revert "fix(backend): ServerStatsService start within running app"
Browse files Browse the repository at this point in the history
This reverts commit a4d2c54.
  • Loading branch information
ZerglingGo committed Aug 24, 2023
1 parent 41c29eb commit 4d71ad5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
2 changes: 0 additions & 2 deletions packages/backend/src/server/api/EndpointsModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ import * as ep___fetchRss from './endpoints/fetch-rss.js';
import * as ep___retention from './endpoints/retention.js';
import { GetterService } from './GetterService.js';
import { ApiLoggerService } from './ApiLoggerService.js';
import { ServerStatsService } from '@/daemons/ServerStatsService.js';
import type { Provider } from '@nestjs/common';

const $admin_meta: Provider = { provide: 'ep:admin/meta', useClass: ep___admin_meta.default };
Expand Down Expand Up @@ -703,7 +702,6 @@ const $retention: Provider = { provide: 'ep:retention', useClass: ep___retention
providers: [
GetterService,
ApiLoggerService,
ServerStatsService,
$admin_meta,
$admin_abuseUserReports,
$admin_accounts_create,
Expand Down
12 changes: 0 additions & 12 deletions packages/backend/src/server/api/endpoints/admin/update-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
*/

import { Injectable } from '@nestjs/common';
import { ModuleRef } from '@nestjs/core';
import type { MiMeta } from '@/models/entities/Meta.js';
import { ModerationLogService } from '@/core/ModerationLogService.js';
import { Endpoint } from '@/server/api/endpoint-base.js';
import { MetaService } from '@/core/MetaService.js';
import { ServerStatsService } from '@/daemons/ServerStatsService.js';

export const meta = {
tags: ['admin'],
Expand Down Expand Up @@ -113,8 +111,6 @@ export const paramDef = {
@Injectable()
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export
constructor(
private moduleRef: ModuleRef,

private metaService: MetaService,
private moderationLogService: ModerationLogService,
) {
Expand Down Expand Up @@ -427,14 +423,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-

await this.metaService.update(set);
this.moderationLogService.insertModerationLog(me, 'updateMeta');

if (set.enableServerMachineStats === true) {
const serverStatsService: ServerStatsService = await this.moduleRef.resolve(ServerStatsService);
await serverStatsService.start();
} else {
const serverStatsService: ServerStatsService = await this.moduleRef.resolve(ServerStatsService);
serverStatsService.dispose();
}
});
}
}

0 comments on commit 4d71ad5

Please sign in to comment.