refactor: reorganize cache TTL constants - #4550
Conversation
|
@qwerty541 is attempting to deploy a commit to the github readme stats Team on Vercel. A member of the Team first needs to authorize it. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4550 +/- ##
==========================================
+ Coverage 97.03% 97.65% +0.61%
==========================================
Files 29 30 +1
Lines 6955 7107 +152
Branches 566 584 +18
==========================================
+ Hits 6749 6940 +191
+ Misses 202 163 -39
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR refactors cache TTL constants by moving them from the utils.js file to a dedicated cache.js file, creating a more organized structure with DURATIONS and CACHE_TTL objects. The refactoring improves code organization by centralizing cache-related constants and making them more semantically clear.
- Moved cache duration constants from
CONSTANTSinutils.jstoDURATIONSincache.js - Created structured
CACHE_TTLobject with card-specific cache configurations - Updated all imports and references across API endpoints and tests
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/common/cache.js | Added DURATIONS and CACHE_TTL constants, exported new cache-related objects |
| src/common/utils.js | Removed cache-related constants from CONSTANTS object |
| src/common/index.js | Removed CONSTANTS from exports and added type check comment |
| api/*.js | Updated imports and references to use new CACHE_TTL structure |
| tests/*.js | Updated test imports and assertions to use new cache constants |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
No description provided.