Skip to content

Commit

Permalink
Merge pull request #3 from hao4/fix-error
Browse files Browse the repository at this point in the history
Handle InvalidSequenceTokenException
  • Loading branch information
pling authored Feb 11, 2020
2 parents 269eaf3 + 2ad7b1d commit 4e8ccdb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ module.exports = class CloudWatchStream extends EventEmitter {
if (error) {
if (error.retryable && attempts++ < 5) {
setTimeout(postLogEvents, 100);
} else if (error.code === 'InvalidSequenceTokenException') {
delete that._sequenceToken;
that._getSequenceToken(postLogEvents)
} else {
callback(error);
}
Expand Down

0 comments on commit 4e8ccdb

Please sign in to comment.