Skip to content

Commit

Permalink
chore: restored comments that were deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
khatruong2009 committed Sep 22, 2023
1 parent 0f916c0 commit 422a196
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,28 @@ class CloudWatchLoggerPlugin extends AWSLoggerPlugin
tooNewException = _TooNewLogEventException(
events[tooNewStartIndex!].timestamp.toInt(),
);
// set logs to end before the index.

logs.removeRange(tooNewStartIndex, events.length);
// set events to end before the index.
events.removeRange(tooNewStartIndex, events.length);
}

if (_isValidIndex(tooOldEndIndex, events.length)) {
// remove old logs from log store.
await _logStore.deleteItems(
logs.sublist(0, tooOldEndIndex! + 1),
);

// set logs to start after the index.
logs.removeRange(0, tooOldEndIndex + 1);
// set events to start after the index.
events.removeRange(0, tooOldEndIndex + 1);
}
}

// after sending each batch to CloudWatch check if the batch has
// `tooNewException` and throw to stop syncing next batches.

if (tooNewException != null) {
throw tooNewException;
}
Expand Down

0 comments on commit 422a196

Please sign in to comment.