fix(medusa): Remove default job age option from EventBus (#3388)
* fix(medusa): Remove default job age option from EventBus * Create .changeset/spicy-camels-invite.md
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/medusa": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(medusa): Remove default job age option from EventBus
|
||||||
@@ -49,8 +49,6 @@ export type EmitOptions = {
|
|||||||
}
|
}
|
||||||
} & JobOptions
|
} & JobOptions
|
||||||
|
|
||||||
const COMPLETED_JOB_TTL = 10000
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can keep track of multiple subscribers to different events and run the
|
* Can keep track of multiple subscribers to different events and run the
|
||||||
* subscribers when events happen. Events will run asynchronously.
|
* subscribers when events happen. Events will run asynchronously.
|
||||||
@@ -228,9 +226,7 @@ export default class EventBusService {
|
|||||||
options: Record<string, unknown> & EmitOptions = { attempts: 1 }
|
options: Record<string, unknown> & EmitOptions = { attempts: 1 }
|
||||||
): Promise<StagedJob | void> {
|
): Promise<StagedJob | void> {
|
||||||
const opts: EmitOptions = {
|
const opts: EmitOptions = {
|
||||||
removeOnComplete: {
|
removeOnComplete: true,
|
||||||
age: COMPLETED_JOB_TTL,
|
|
||||||
},
|
|
||||||
...options,
|
...options,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user