mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-05-25 15:58:47 +00:00
feat: rate limit error chaching (#2448)
* feat: rate limit error chaching Rate limit error caching to alleviate PATs. * refactor: improve code comments
This commit is contained in:
@@ -72,5 +72,5 @@ const retryer = async (fetcher, variables, retries = 0) => {
|
||||
}
|
||||
};
|
||||
|
||||
export { retryer };
|
||||
export { retryer, RETRIES };
|
||||
export default retryer;
|
||||
|
||||
@@ -373,11 +373,21 @@ const noop = () => {};
|
||||
const logger =
|
||||
process.env.NODE_ENV !== "test" ? console : { log: noop, error: noop };
|
||||
|
||||
// Cache settings.
|
||||
const CARD_CACHE_SECONDS = 14400;
|
||||
const ERROR_CACHE_SECONDS = 600;
|
||||
|
||||
const CONSTANTS = {
|
||||
ONE_MINUTE: 60,
|
||||
FIVE_MINUTES: 300,
|
||||
TEN_MINUTES: 600,
|
||||
FIFTEEN_MINUTES: 900,
|
||||
THIRTY_MINUTES: 1800,
|
||||
TWO_HOURS: 7200,
|
||||
FOUR_HOURS: 14400,
|
||||
ONE_DAY: 86400,
|
||||
CARD_CACHE_SECONDS,
|
||||
ERROR_CACHE_SECONDS,
|
||||
};
|
||||
|
||||
const SECONDARY_ERROR_MESSAGES = {
|
||||
|
||||
Reference in New Issue
Block a user