Skip to content

Commit cae5c34

Browse files
committed
Configurable intervalInMs via constructor.
1 parent 67808d5 commit cae5c34

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/outbox-core/lib/outbox.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class OutboxProcessor<SupportedEvents extends CommonEventDefinition[]> {
9595
}
9696

9797
/**
98-
* Periodic job that processes outbox entries every second. If processing takes longer than 1 second, another subsequent job WILL NOT be started.
98+
* Periodic job that processes outbox entries every "intervalInMs". If processing takes longer than defined interval, another subsequent job WILL NOT be started.
9999
*
100100
* Each entry is ACKed, then event is published, and then entry is marked as SUCCESS. If processing fails, entry is marked as FAILED and will be retried.
101101
*
@@ -109,14 +109,15 @@ export class OutboxPeriodicJob<
109109
constructor(
110110
outboxStorage: OutboxStorage<SupportedEvents>,
111111
eventEmitter: DomainEventEmitter<SupportedEvents>,
112-
maxRetryCount: number,
113112
dependencies: PeriodicJobDependencies,
113+
maxRetryCount: number,
114+
intervalInMs: number,
114115
) {
115116
super(
116117
{
117118
jobId: 'OutboxJob',
118119
schedule: {
119-
intervalInMs: 1000,
120+
intervalInMs: intervalInMs,
120121
},
121122
singleConsumerMode: {
122123
enabled: true,

0 commit comments

Comments
 (0)