Skip to content

refactor: reorganize cache TTL constants - #4550

Merged
qwerty541 merged 2 commits into
anuraghazra:masterfrom
qwerty541:refactor_cache_const
Oct 9, 2025
Merged

refactor: reorganize cache TTL constants#4550
qwerty541 merged 2 commits into
anuraghazra:masterfrom
qwerty541:refactor_cache_const

Conversation

@opheliagoldstein

Copy link
Copy Markdown
Contributor

No description provided.

@vercel

vercel Bot commented Oct 9, 2025

Copy link
Copy Markdown

@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.

@github-actions github-actions Bot added stats-card Feature, Enhancement, Fixes related to stats the stats card. repo-card Issues related to the pin/repo card. lang-card Issues related to the language card. wakatime-card Issues related to the wakatime card. gist-card labels Oct 9, 2025

@opheliagoldstein opheliagoldstein left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

@qwerty541
qwerty541 requested a review from Copilot October 9, 2025 00:39
@codecov

codecov Bot commented Oct 9, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.65%. Comparing base (ade7d53) to head (5d03239).
⚠️ Report is 17 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CONSTANTS in utils.js to DURATIONS in cache.js
  • Created structured CACHE_TTL object 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.

Comment thread tests/wakatime.test.js Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@qwerty541
qwerty541 merged commit 0afa6c4 into anuraghazra:master Oct 9, 2025
7 of 8 checks passed
@qwerty541
qwerty541 deleted the refactor_cache_const branch October 9, 2025 00:41
harryzcy pushed a commit to harryzcy/github-readme-stats that referenced this pull request Oct 15, 2025
* 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>
martin-mfg pushed a commit to stats-organization/github-stats-extended that referenced this pull request Nov 2, 2025
* 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>
ghosind pushed a commit to ghosind/github-readme-stats that referenced this pull request Dec 30, 2025
* 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>
zimya pushed a commit to zimya/github-readme-stats-cf that referenced this pull request Jan 13, 2026
* 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>
piscis pushed a commit to piscis/github-readme-stats that referenced this pull request Feb 7, 2026
* 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>
zntb added a commit to zntb/github-readme-stats that referenced this pull request Jul 27, 2026
* 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>
zntb added a commit to zntb/github-readme-stats that referenced this pull request Jul 27, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gist-card lang-card Issues related to the language card. repo-card Issues related to the pin/repo card. stats-card Feature, Enhancement, Fixes related to stats the stats card. wakatime-card Issues related to the wakatime card.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants