Skip to content

Commit

Permalink
fix(job-queue-plugin): correct default worker options
Browse files Browse the repository at this point in the history
  • Loading branch information
areg-gareginyan-im committed Nov 22, 2024
1 parent b3d32f6 commit 492fd52
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions packages/job-queue-plugin/src/bullmq/bullmq-job-queue-strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,18 @@ export class BullMQJobQueueStrategy implements InspectableJobQueueStrategy {

private initOptions(injector: Injector): BullMQPluginOptions {
const options = injector.get<BullMQPluginOptions>(BULLMQ_PLUGIN_OPTIONS);
if (!options.workerOptions) {
options.workerOptions = {};
options.workerOptions = {
...(options.workerOptions ?? {
removeOnComplete: {
age: 60 * 60 * 24 * 30,
count: 5000,
},
removeOnFail: {
age: 60 * 60 * 24 * 30,
count: 5000,
},
})
}
options.workerOptions.removeOnComplete = options.workerOptions.removeOnComplete || {
age: 60 * 60 * 24 * 30,
count: 5000,
};
options.workerOptions.removeOnFail = options.workerOptions.removeOnFail || {
age: 60 * 60 * 24 * 30,
count: 5000,
};
return options
}

Expand Down

0 comments on commit 492fd52

Please sign in to comment.