rename activity_log and activity_context to ap_inbox_log and ap_context

This commit is contained in:
Hazelnoot 2024-12-09 10:00:25 -05:00
parent 0979392925
commit cc2edae7ab
11 changed files with 113 additions and 65 deletions

View file

@ -8,7 +8,7 @@ import { LessThan } from 'typeorm';
import { DI } from '@/di-symbols.js';
import type { Config } from '@/config.js';
import { bindThis } from '@/decorators.js';
import type { ActivityLogsRepository } from '@/models/_.js';
import type { ApInboxLogsRepository } from '@/models/_.js';
import { LoggerService } from '@/core/LoggerService.js';
import Logger from '@/logger.js';
@ -16,7 +16,7 @@ import Logger from '@/logger.js';
export const scanInterval = 1000 * 60 * 10;
@Injectable()
export class ActivityLogCleanupService implements OnApplicationShutdown {
export class ApLogCleanupService implements OnApplicationShutdown {
private readonly logger: Logger;
private scanTimer: NodeJS.Timeout | null = null;
@ -24,8 +24,8 @@ export class ActivityLogCleanupService implements OnApplicationShutdown {
@Inject(DI.config)
private readonly config: Config,
@Inject(DI.activityLogsRepository)
private readonly activityLogsRepository: ActivityLogsRepository,
@Inject(DI.apInboxLogsRepository)
private readonly apInboxLogsRepository: ApInboxLogsRepository,
loggerService: LoggerService,
) {
@ -51,7 +51,7 @@ export class ActivityLogCleanupService implements OnApplicationShutdown {
const oldestAllowed = new Date(Date.now() - this.config.activityLogging.maxAge);
// Delete all logs older than the threshold.
const { affected } = await this.activityLogsRepository.delete({
const { affected } = await this.apInboxLogsRepository.delete({
at: LessThan(oldestAllowed),
});

View file

@ -8,7 +8,7 @@ import { CoreModule } from '@/core/CoreModule.js';
import { GlobalModule } from '@/GlobalModule.js';
import { QueueStatsService } from './QueueStatsService.js';
import { ServerStatsService } from './ServerStatsService.js';
import { ActivityLogCleanupService } from './ActivityLogCleanupService.js';
import { ApLogCleanupService } from './ApLogCleanupService.js';
@Module({
imports: [
@ -18,12 +18,12 @@ import { ActivityLogCleanupService } from './ActivityLogCleanupService.js';
providers: [
QueueStatsService,
ServerStatsService,
ActivityLogCleanupService,
ApLogCleanupService,
],
exports: [
QueueStatsService,
ServerStatsService,
ActivityLogCleanupService,
ApLogCleanupService,
],
})
export class DaemonModule {}