File tree Expand file tree Collapse file tree 4 files changed +9
-3
lines changed Expand file tree Collapse file tree 4 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export interface ConsumerOptions {
12
12
waitTimeSeconds ?: number ;
13
13
authenticationErrorTimeout ?: number ;
14
14
pollingWaitTimeMs ?: number ;
15
+ pollingWaitTimeMsBatchSizeZero ?: number ;
15
16
terminateVisibilityTimeout ?: boolean ;
16
17
sqs ?: SQS ;
17
18
region ?: string ;
@@ -39,6 +40,7 @@ export declare class Consumer extends EventEmitter {
39
40
private waitTimeSeconds ;
40
41
private authenticationErrorTimeout ;
41
42
private pollingWaitTimeMs ;
43
+ private pollingWaitTimeMsBatchSizeZero ;
42
44
private terminateVisibilityTimeout ;
43
45
private sqs ;
44
46
constructor ( options : ConsumerOptions ) ;
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ class Consumer extends events_1.EventEmitter {
79
79
this . waitTimeSeconds = options . waitTimeSeconds || 20 ;
80
80
this . authenticationErrorTimeout = options . authenticationErrorTimeout || 10000 ;
81
81
this . pollingWaitTimeMs = options . pollingWaitTimeMs || 0 ;
82
+ this . pollingWaitTimeMsBatchSizeZero = options . pollingWaitTimeMsBatchSizeZero || 5 ;
82
83
this . sqs =
83
84
options . sqs ||
84
85
new SQS ( {
@@ -292,7 +293,7 @@ class Consumer extends events_1.EventEmitter {
292
293
} ) ;
293
294
}
294
295
else {
295
- setTimeout ( this . poll , currentPollingTimeout ) ;
296
+ setTimeout ( this . poll , this . pollingWaitTimeMsBatchSizeZero ) ;
296
297
}
297
298
}
298
299
async processMessageBatch ( messages ) {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " sqs-consumer" ,
3
- "version" : " 5.7.6 " ,
3
+ "version" : " 5.7.7 " ,
4
4
"description" : " Build SQS-based Node applications without the boilerplate" ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ export interface ConsumerOptions {
89
89
waitTimeSeconds ?: number ;
90
90
authenticationErrorTimeout ?: number ;
91
91
pollingWaitTimeMs ?: number ;
92
+ pollingWaitTimeMsBatchSizeZero ?: number ;
92
93
terminateVisibilityTimeout ?: boolean ;
93
94
sqs ?: SQS ;
94
95
region ?: string ;
@@ -117,6 +118,7 @@ export class Consumer extends EventEmitter {
117
118
private waitTimeSeconds : number ;
118
119
private authenticationErrorTimeout : number ;
119
120
private pollingWaitTimeMs : number ;
121
+ private pollingWaitTimeMsBatchSizeZero : number ;
120
122
private terminateVisibilityTimeout : boolean ;
121
123
private sqs : SQS ;
122
124
@@ -140,6 +142,7 @@ export class Consumer extends EventEmitter {
140
142
this . waitTimeSeconds = options . waitTimeSeconds || 20 ;
141
143
this . authenticationErrorTimeout = options . authenticationErrorTimeout || 10000 ;
142
144
this . pollingWaitTimeMs = options . pollingWaitTimeMs || 0 ;
145
+ this . pollingWaitTimeMsBatchSizeZero = options . pollingWaitTimeMsBatchSizeZero || 5 ;
143
146
144
147
this . sqs =
145
148
options . sqs ||
@@ -371,7 +374,7 @@ export class Consumer extends EventEmitter {
371
374
this . emit ( 'error' , err ) ;
372
375
} ) ;
373
376
} else {
374
- setTimeout ( this . poll , currentPollingTimeout ) ;
377
+ setTimeout ( this . poll , this . pollingWaitTimeMsBatchSizeZero ) ;
375
378
}
376
379
}
377
380
You can’t perform that action at this time.
0 commit comments