mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 10:06:17 +08:00
feat(server): handle workspace doc updates (#11937)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user