fix(server): wrong queue options for worker executor (#10267)

This commit is contained in:
liuyi
2025-02-19 04:44:23 +00:00
committed by GitHub
parent 320875425c
commit 294002101d
3 changed files with 11 additions and 3 deletions
@@ -29,9 +29,15 @@ defineStartupConfig('job', {
queue: { queue: {
prefix: 'affine_job', prefix: 'affine_job',
defaultJobOptions: { defaultJobOptions: {
attempts: 3, attempts: 5,
removeOnComplete: true, removeOnComplete: {
removeOnFail: false, age: 3600 /* 1h */,
count: 100,
},
removeOnFail: {
age: 24 * 3600 /* 1 day */,
count: 500,
},
}, },
}, },
worker: {}, worker: {},
@@ -121,6 +121,7 @@ export class JobExecutor
await this.run(job.name as JobName, job.data); await this.run(job.name as JobName, job.data);
}, },
{ {
...this.config.job.queue,
...this.config.job.worker, ...this.config.job.worker,
connection: this.redis, connection: this.redis,
concurrency, concurrency,
@@ -106,6 +106,7 @@ export class PgWorkspaceDocStorageAdapter extends DocStorageAdapter {
{ {
// keep it simple to let all update merged in one job // keep it simple to let all update merged in one job
jobId: `doc:merge-pending-updates:${workspaceId}:${docId}`, jobId: `doc:merge-pending-updates:${workspaceId}:${docId}`,
delay: 30 * 1000 /* 30s */,
} }
); );
turn++; turn++;