feat(server): stop embedding in doc embedding disabled workspace (#11761)

fix AI-33
This commit is contained in:
darkskygit
2025-04-17 09:57:33 +00:00
parent e577bb7aa9
commit 570dc79e3d
8 changed files with 50 additions and 1 deletions

View File

@@ -77,6 +77,12 @@ export class CopilotContextDocJob {
contextId?: string
) {
if (!this.supportEmbedding) return;
const allowEmbedding = await this.models.workspace.allowEmbedding(
docs[0]?.workspaceId
);
if (!allowEmbedding) {
return;
}
for (const { workspaceId, docId } of docs) {
await this.queue.add('copilot.embedding.docs', {