Skip to content

Redis cache set ttl in ms instead of seconds #2539

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
1 task done
ramiel opened this issue Apr 2, 2025 · 0 comments · May be fixed by #2540
Open
1 task done

Redis cache set ttl in ms instead of seconds #2539

ramiel opened this issue Apr 2, 2025 · 0 comments · May be fixed by #2540

Comments

@ramiel
Copy link

ramiel commented Apr 2, 2025

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

  • [-] 1. The issue provides a
    minimal reproduction available on
    Stackblitz.
    • Please install the latest @envelop/* packages that you are using.
    • Please make sure the reproduction is as small as possible.
  • [-] 2. A failing test has been provided
  • 3. A local solution has been provided
  • [-] 4. A pull request is pending review

Describe the bug

The code in response-cache-redis is

if (ttl === Infinity) {
        pipeline.set(responseId, JSON.stringify(result));
      } else {
        // set the ttl in milliseconds
        pipeline.set(responseId, JSON.stringify(result), 'PX', ttl);
      }

and it clearly set the ttl in milliseconds. The ttl in the response cache is set in seconds though.

To Reproduce Steps to reproduce the behavior:

Expected behavior

Seconds should be used

Environment:

  • OS: any
  • NodeJS: any
  • @envelop/* versions: any
    • @envelop/core: any

Additional context

@ramiel ramiel linked a pull request Apr 2, 2025 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant