Skip to content

Redis cache set ttl in ms instead of seconds #2539

Open
@ramiel

Description

@ramiel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions