From 94ddcc7a7a59ce5831e5398f35dd9a61ce9f71f6 Mon Sep 17 00:00:00 2001 From: darkskygit Date: Wed, 2 Apr 2025 10:51:36 +0000 Subject: [PATCH] chore(server): move embedding job namespace (#11397) --- .../server/src/plugins/copilot/context/job.ts | 14 +++++++------- .../server/src/plugins/copilot/context/types.ts | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/backend/server/src/plugins/copilot/context/job.ts b/packages/backend/server/src/plugins/copilot/context/job.ts index 1b71eaa8b..1943b4257 100644 --- a/packages/backend/server/src/plugins/copilot/context/job.ts +++ b/packages/backend/server/src/plugins/copilot/context/job.ts @@ -58,11 +58,11 @@ export class CopilotContextDocJob { return this.client as EmbeddingClient; } - async addFileEmbeddingQueue(file: Jobs['doc.embedPendingFiles']) { + async addFileEmbeddingQueue(file: Jobs['copilot.embedding.files']) { if (!this.supportEmbedding) return; const { userId, workspaceId, contextId, blobId, fileId, fileName } = file; - await this.queue.add('doc.embedPendingFiles', { + await this.queue.add('copilot.embedding.files', { userId, workspaceId, contextId, @@ -80,7 +80,7 @@ export class CopilotContextDocJob { if (!this.supportEmbedding) return; for (const { workspaceId, docId } of docs) { - await this.queue.add('doc.embedPendingDocs', { + await this.queue.add('copilot.embedding.docs', { contextId, workspaceId, docId, @@ -100,7 +100,7 @@ export class CopilotContextDocJob { return new File([buffer], fileName); } - @OnJob('doc.embedPendingFiles') + @OnJob('copilot.embedding.files') async embedPendingFile({ userId, workspaceId, @@ -108,7 +108,7 @@ export class CopilotContextDocJob { blobId, fileId, fileName, - }: Jobs['doc.embedPendingFiles']) { + }: Jobs['copilot.embedding.files']) { if (!this.supportEmbedding || !this.embeddingClient) return; try { @@ -149,12 +149,12 @@ export class CopilotContextDocJob { } } - @OnJob('doc.embedPendingDocs') + @OnJob('copilot.embedding.docs') async embedPendingDocs({ contextId, workspaceId, docId, - }: Jobs['doc.embedPendingDocs']) { + }: Jobs['copilot.embedding.docs']) { if (!this.supportEmbedding) return; try { diff --git a/packages/backend/server/src/plugins/copilot/context/types.ts b/packages/backend/server/src/plugins/copilot/context/types.ts index ac089b995..a40cf5874 100644 --- a/packages/backend/server/src/plugins/copilot/context/types.ts +++ b/packages/backend/server/src/plugins/copilot/context/types.ts @@ -29,13 +29,13 @@ declare global { }; } interface Jobs { - 'doc.embedPendingDocs': { + 'copilot.embedding.docs': { contextId?: string; workspaceId: string; docId: string; }; - 'doc.embedPendingFiles': { + 'copilot.embedding.files': { contextId: string; userId: string; workspaceId: string;