chore(server): move embedding job namespace (#11397)

This commit is contained in:
darkskygit
2025-04-02 10:51:36 +00:00
parent c4c6cdb6f2
commit 94ddcc7a7a
2 changed files with 9 additions and 9 deletions

View File

@@ -58,11 +58,11 @@ export class CopilotContextDocJob {
return this.client as EmbeddingClient; return this.client as EmbeddingClient;
} }
async addFileEmbeddingQueue(file: Jobs['doc.embedPendingFiles']) { async addFileEmbeddingQueue(file: Jobs['copilot.embedding.files']) {
if (!this.supportEmbedding) return; if (!this.supportEmbedding) return;
const { userId, workspaceId, contextId, blobId, fileId, fileName } = file; const { userId, workspaceId, contextId, blobId, fileId, fileName } = file;
await this.queue.add('doc.embedPendingFiles', { await this.queue.add('copilot.embedding.files', {
userId, userId,
workspaceId, workspaceId,
contextId, contextId,
@@ -80,7 +80,7 @@ export class CopilotContextDocJob {
if (!this.supportEmbedding) return; if (!this.supportEmbedding) return;
for (const { workspaceId, docId } of docs) { for (const { workspaceId, docId } of docs) {
await this.queue.add('doc.embedPendingDocs', { await this.queue.add('copilot.embedding.docs', {
contextId, contextId,
workspaceId, workspaceId,
docId, docId,
@@ -100,7 +100,7 @@ export class CopilotContextDocJob {
return new File([buffer], fileName); return new File([buffer], fileName);
} }
@OnJob('doc.embedPendingFiles') @OnJob('copilot.embedding.files')
async embedPendingFile({ async embedPendingFile({
userId, userId,
workspaceId, workspaceId,
@@ -108,7 +108,7 @@ export class CopilotContextDocJob {
blobId, blobId,
fileId, fileId,
fileName, fileName,
}: Jobs['doc.embedPendingFiles']) { }: Jobs['copilot.embedding.files']) {
if (!this.supportEmbedding || !this.embeddingClient) return; if (!this.supportEmbedding || !this.embeddingClient) return;
try { try {
@@ -149,12 +149,12 @@ export class CopilotContextDocJob {
} }
} }
@OnJob('doc.embedPendingDocs') @OnJob('copilot.embedding.docs')
async embedPendingDocs({ async embedPendingDocs({
contextId, contextId,
workspaceId, workspaceId,
docId, docId,
}: Jobs['doc.embedPendingDocs']) { }: Jobs['copilot.embedding.docs']) {
if (!this.supportEmbedding) return; if (!this.supportEmbedding) return;
try { try {

View File

@@ -29,13 +29,13 @@ declare global {
}; };
} }
interface Jobs { interface Jobs {
'doc.embedPendingDocs': { 'copilot.embedding.docs': {
contextId?: string; contextId?: string;
workspaceId: string; workspaceId: string;
docId: string; docId: string;
}; };
'doc.embedPendingFiles': { 'copilot.embedding.files': {
contextId: string; contextId: string;
userId: string; userId: string;
workspaceId: string; workspaceId: string;