-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Inkvi
committed
Apr 10, 2024
1 parent
4f304f4
commit 0e3a5af
Showing
2 changed files
with
41 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import logger from "./logger"; | ||
|
||
export const defaultRetryOpts = { | ||
retries: 3, // The maximum amount of times to retry the operation. | ||
factor: 2, // The exponential factor to use. | ||
minTimeout: 1000, // The number of milliseconds before starting the first retry. | ||
maxTimeout: 5000, // The maximum number of milliseconds between two retries. | ||
// Custom retry strategy or additional logging can be specified here | ||
onRetry: (err: Error, attempt: number) => { | ||
// This is a good place to log retry attempts if needed | ||
logger.info(`Retry attempt ${attempt} due to error: ${err.message}`); | ||
}, | ||
}; |