refactor(server): enhance the Logger usage (#9763)

This commit is contained in:
Brooooooklyn
2025-01-17 12:12:14 +00:00
parent d8727c2001
commit 779029148e
5 changed files with 16 additions and 19 deletions

View File

@@ -1,9 +1,8 @@
import { Injectable, OnModuleInit, Optional } from '@nestjs/common';
import { Injectable, Logger, OnModuleInit, Optional } from '@nestjs/common';
import { Cron, CronExpression, SchedulerRegistry } from '@nestjs/schedule';
import { PrismaClient } from '@prisma/client';
import {
AFFiNELogger,
CallMetric,
Config,
type EventPayload,
@@ -15,16 +14,14 @@ import { PgWorkspaceDocStorageAdapter } from './adapters/workspace';
@Injectable()
export class DocStorageCronJob implements OnModuleInit {
private busy = false;
private readonly logger = new Logger(DocStorageCronJob.name);
constructor(
private readonly config: Config,
private readonly db: PrismaClient,
private readonly workspace: PgWorkspaceDocStorageAdapter,
private readonly logger: AFFiNELogger,
@Optional() private readonly registry?: SchedulerRegistry
) {
this.logger.setContext(DocStorageCronJob.name);
}
) {}
onModuleInit() {
if (this.registry && this.config.doc.manager.enableUpdateAutoMerging) {