Skip to content

Commit

Permalink
stops after retries reached maximum number
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhengshs committed Sep 16, 2024
1 parent 6d98cda commit 3ba6b64
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/core/src/Providers/AWSCloudWatchProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,19 +496,19 @@ class AWSCloudWatchProvider implements LoggingProvider {
try {
if (this._getDocUploadPermissibility()) {
await this._safeUploadLogEvents();
this._retryCount = 0;
}
} catch (err) {
this._retryCount++;
if (this._retryCount < this._maxRetries) {
if (this._retryCount > this._maxRetries) {
logger.error(
`error when calling _safeUploadLogEvents in the timer interval - ${err}`
);
} else if (this._retryCount === this._maxRetries) {
logger.error(
`CloudWatch log upload failed after ${this._maxRetries} attempts. Suppressing further error logs. Upload attempts will continue in the background.`
`Max retries (${this._maxRetries}) reached. Stopping log uploads.`
);
clearInterval(this._timer);
return;
}
logger.error(
`error when calling _safeUploadLogEvents in the timer interval - ${err}`
);
}
}, 2000);
}
Expand Down

0 comments on commit 3ba6b64

Please sign in to comment.