mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
fix(server): wrong queue options for worker executor (#10267)
This commit is contained in:
@@ -29,9 +29,15 @@ defineStartupConfig('job', {
|
||||
queue: {
|
||||
prefix: 'affine_job',
|
||||
defaultJobOptions: {
|
||||
attempts: 3,
|
||||
removeOnComplete: true,
|
||||
removeOnFail: false,
|
||||
attempts: 5,
|
||||
removeOnComplete: {
|
||||
age: 3600 /* 1h */,
|
||||
count: 100,
|
||||
},
|
||||
removeOnFail: {
|
||||
age: 24 * 3600 /* 1 day */,
|
||||
count: 500,
|
||||
},
|
||||
},
|
||||
},
|
||||
worker: {},
|
||||
|
||||
@@ -121,6 +121,7 @@ export class JobExecutor
|
||||
await this.run(job.name as JobName, job.data);
|
||||
},
|
||||
{
|
||||
...this.config.job.queue,
|
||||
...this.config.job.worker,
|
||||
connection: this.redis,
|
||||
concurrency,
|
||||
|
||||
@@ -106,6 +106,7 @@ export class PgWorkspaceDocStorageAdapter extends DocStorageAdapter {
|
||||
{
|
||||
// keep it simple to let all update merged in one job
|
||||
jobId: `doc:merge-pending-updates:${workspaceId}:${docId}`,
|
||||
delay: 30 * 1000 /* 30s */,
|
||||
}
|
||||
);
|
||||
turn++;
|
||||
|
||||
Reference in New Issue
Block a user