refactor: reorganize cache TTL constants (#4550)

* refactor: reorganize cache TTL constants

* Update tests/wakatime.test.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Ophelia Goldstein
2025-10-09 03:41:02 +03:00
committed by GitHub
co-authored by Copilot Alexandr
parent 3c22841a82
commit 0afa6c4e78
13 changed files with 158 additions and 103 deletions
-29
View File
@@ -452,34 +452,6 @@ const noop = () => {};
const logger =
process.env.NODE_ENV === "test" ? { log: noop, error: noop } : console;
const MIN = 60;
const HOUR = 60 * MIN;
const DAY = 24 * HOUR;
const CONSTANTS = {
ONE_MINUTE: MIN,
FIVE_MINUTES: 5 * MIN,
TEN_MINUTES: 10 * MIN,
FIFTEEN_MINUTES: 15 * MIN,
THIRTY_MINUTES: 30 * MIN,
TWO_HOURS: 2 * HOUR,
FOUR_HOURS: 4 * HOUR,
SIX_HOURS: 6 * HOUR,
EIGHT_HOURS: 8 * HOUR,
TWELVE_HOURS: 12 * HOUR,
ONE_DAY: DAY,
TWO_DAY: 2 * DAY,
SIX_DAY: 6 * DAY,
TEN_DAY: 10 * DAY,
CARD_CACHE_SECONDS: DAY,
TOP_LANGS_CACHE_SECONDS: 6 * DAY,
PIN_CARD_CACHE_SECONDS: 10 * DAY,
ERROR_CACHE_SECONDS: 10 * MIN,
};
/**
* Missing query parameter class.
*/
@@ -648,7 +620,6 @@ export {
getCardColors,
wrapTextMultiline,
logger,
CONSTANTS,
CustomError,
MissingParamError,
measureText,