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;
}
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 {

View File

@@ -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;