fix(server): don't use global AFFiNELogger (#12871)
 #### PR Dependency Tree * **PR #12871** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Updated internal logging mechanism to use a standard logger, resulting in a simplified and more consistent logging approach. No changes to user-facing features or functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai --> #### PR Dependency Tree * **PR #12871** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal)
This commit is contained in:
@@ -1,8 +1,7 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
import { ModuleRef } from '@nestjs/core';
|
import { ModuleRef } from '@nestjs/core';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AFFiNELogger,
|
|
||||||
BlobNotFound,
|
BlobNotFound,
|
||||||
CallMetric,
|
CallMetric,
|
||||||
CopilotContextFileNotSupported,
|
CopilotContextFileNotSupported,
|
||||||
@@ -22,6 +21,7 @@ import { EMBEDDING_DIMENSIONS, EmbeddingClient } from './types';
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CopilotEmbeddingJob {
|
export class CopilotEmbeddingJob {
|
||||||
|
private readonly logger = new Logger(CopilotEmbeddingJob.name);
|
||||||
private readonly workspaceJobAbortController: Map<string, AbortController> =
|
private readonly workspaceJobAbortController: Map<string, AbortController> =
|
||||||
new Map();
|
new Map();
|
||||||
|
|
||||||
@@ -32,13 +32,10 @@ export class CopilotEmbeddingJob {
|
|||||||
private readonly moduleRef: ModuleRef,
|
private readonly moduleRef: ModuleRef,
|
||||||
private readonly doc: DocReader,
|
private readonly doc: DocReader,
|
||||||
private readonly event: EventBus,
|
private readonly event: EventBus,
|
||||||
private readonly logger: AFFiNELogger,
|
|
||||||
private readonly models: Models,
|
private readonly models: Models,
|
||||||
private readonly queue: JobQueue,
|
private readonly queue: JobQueue,
|
||||||
private readonly storage: CopilotStorage
|
private readonly storage: CopilotStorage
|
||||||
) {
|
) {}
|
||||||
this.logger.setContext(CopilotEmbeddingJob.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnEvent('config.init')
|
@OnEvent('config.init')
|
||||||
async onConfigInit() {
|
async onConfigInit() {
|
||||||
|
|||||||
Reference in New Issue
Block a user