Skip to content

redis cache set ttl in seconds #2540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

redis cache set ttl in seconds #2540

wants to merge 3 commits into from

Conversation

ramiel
Copy link

@ramiel ramiel commented Apr 2, 2025

🚨 IMPORTANT: Please do not create a Pull Request without creating an issue first.

Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of
the pull request.

Description

Redis cache for response-cache should follow
the same ttl meaning of the related plugin, so ttl should be in seconds.

Fixes #2539

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have followed the
    CONTRIBUTING doc and the
    style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Redis cache for response-cache should follow
the same ttl meaning of the related plugin, so ttl should be in seconds
@saihaj saihaj requested review from n1ru4l and ardatan April 7, 2025 07:31
@EmrysMyrddin
Copy link
Collaborator

Hi ! Thank you for your PR !
Can you please run prettier ? It's a bit difficult to review since their is a lot of formatting changes:

pnpm prettier

@ramiel
Copy link
Author

ramiel commented May 14, 2025

Done, sorry for the mess

@ardatan
Copy link
Member

ardatan commented May 14, 2025

Do you think we can have tests?

@ramiel
Copy link
Author

ramiel commented May 15, 2025

Done. I updated the tests to consider the ttl as seconds instead of milliseconds.

The code was expecting the ttl to be given in milliseconds, but the documentation clearly states that the TTL is given in seconds.

@EmrysMyrddin
Copy link
Collaborator

Hi ! I'm not sur to follow where it is stated in the documentation that the TTL is in seconds ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Redis cache set ttl in ms instead of seconds
3 participants