feat(server): handle workspace doc updates (#11937)

This commit is contained in:
fengmk2
2025-05-14 14:52:41 +00:00
parent 6792c3e656
commit afa984da54
33 changed files with 1940 additions and 34 deletions
@@ -61,6 +61,14 @@ defineModuleConfig('job', {
schema,
},
'queues.indexer': {
desc: 'The config for indexer job queue',
default: {
concurrency: 1,
},
schema,
},
'queues.notification': {
desc: 'The config for notification job queue',
default: {
@@ -27,6 +27,7 @@ export enum Queue {
NOTIFICATION = 'notification',
DOC = 'doc',
COPILOT = 'copilot',
INDEXER = 'indexer',
}
export const QUEUES = Object.values(Queue);
@@ -27,11 +27,15 @@ export class JobExecutor implements OnModuleDestroy {
@OnEvent('config.init')
async onConfigInit() {
const queues = env.flavors.graphql ? difference(QUEUES, [Queue.DOC]) : [];
const queues = env.flavors.graphql
? difference(QUEUES, [Queue.DOC, Queue.INDEXER])
: [];
// NOTE(@forehalo): only enable doc queue in doc service
if (env.flavors.doc) {
queues.push(Queue.DOC);
// NOTE(@fengmk2): Once the index task cannot be processed in time, it needs to be separated from the doc service and deployed independently.
queues.push(Queue.INDEXER);
}
await this.startWorkers(queues);