mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-21 00:07:01 +08:00
feat(server): improve context error handle (#11342)
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
import {
|
||||
ContextConfig,
|
||||
ContextConfigSchema,
|
||||
ContextDoc,
|
||||
ContextEmbedStatus,
|
||||
ContextFile,
|
||||
Models,
|
||||
@@ -148,6 +149,18 @@ export class CopilotContextService implements OnApplicationBootstrap {
|
||||
return null;
|
||||
}
|
||||
|
||||
@OnEvent('workspace.doc.embed.failed')
|
||||
async onDocEmbedFailed({
|
||||
contextId,
|
||||
docId,
|
||||
}: Events['workspace.doc.embed.failed']) {
|
||||
const context = await this.get(contextId);
|
||||
await context.saveDocRecord(docId, doc => ({
|
||||
...(doc as ContextDoc),
|
||||
status: ContextEmbedStatus.failed,
|
||||
}));
|
||||
}
|
||||
|
||||
@OnEvent('workspace.file.embed.finished')
|
||||
async onFileEmbedFinish({
|
||||
contextId,
|
||||
|
||||
Reference in New Issue
Block a user