File tree Expand file tree Collapse file tree 1 file changed +12
-16
lines changed
packages/serverless-offline-kinesis/src Expand file tree Collapse file tree 1 file changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ const functionHelper = require('serverless-offline/src/functionHelper');
26
26
const LambdaContext = require ( 'serverless-offline/src/LambdaContext' ) ;
27
27
28
28
const NO_KINESIS_FOUND = 'Could not find kinesis stream' ;
29
- const KINESIS_RETRY_DELAY = 2000 ;
29
+ const KINESIS_RETRY_DELAY = 200 ;
30
30
31
31
const printBlankLine = ( ) => console . log ( ) ;
32
32
@@ -160,22 +160,18 @@ class ServerlessOfflineKinesis {
160
160
. catch ( err => err ) ;
161
161
162
162
if ( kinesisStream instanceof Error ) {
163
- if ( retry ) {
164
- this . serverless . cli . log (
165
- `${ streamName } - not found because of ${
166
- kinesisStream . code
167
- } , retrying in ${ KINESIS_RETRY_DELAY } ms`
168
- ) ;
169
- setTimeout (
170
- this . createKinesisReadable . bind ( this ) ,
171
- KINESIS_RETRY_DELAY ,
172
- functionName ,
173
- streamEvent ,
174
- retry
175
- ) ;
176
- return ;
177
- } else throw new Error ( NO_KINESIS_FOUND ) ;
163
+ if ( ! retry ) throw new Error ( NO_KINESIS_FOUND ) ;
164
+
165
+ this . serverless . cli . log (
166
+ `${ streamName } - not found because of ${
167
+ kinesisStream . code
168
+ } , retrying in ${ KINESIS_RETRY_DELAY } ms`
169
+ ) ;
170
+ return setTimeout ( ( ) => {
171
+ this . createKinesisReadable ( functionName , streamEvent , retry ) ;
172
+ } , KINESIS_RETRY_DELAY ) ;
178
173
}
174
+
179
175
const {
180
176
StreamDescription : { Shards : shards }
181
177
} = kinesisStream ;
You can’t perform that action at this time.
0 commit comments