Skip to content
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

@CacheTTL doesn't override module default ttl #12027

Closed
2 of 15 tasks
Pho3niX90 opened this issue Jul 14, 2023 · 2 comments
Closed
2 of 15 tasks

@CacheTTL doesn't override module default ttl #12027

Pho3niX90 opened this issue Jul 14, 2023 · 2 comments
Labels
needs triage This issue has not been looked into

Comments

@Pho3niX90
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

@CacheTTL has no effect, cache still uses default TTL set on module.

Minimum reproduction code

https://stackblitz.com/edit/nestjs-typescript-starter-mjjolw?file=src%2Fapp.controller.ts

Steps to reproduce

No response

Expected behavior

@CacheTTL should override module TTL for the given controller.

Package

  • I don't know. Or some 3rd-party package
  • @nestjs/common
  • @nestjs/core
  • @nestjs/microservices
  • @nestjs/platform-express
  • @nestjs/platform-fastify
  • @nestjs/platform-socket.io
  • @nestjs/platform-ws
  • @nestjs/testing
  • @nestjs/websockets
  • Other (see below)

Other package

No response

NestJS version

10.0.0

Packages versions

  "dependencies": {
    "@nestjs/cache-manager": "2.0.1",
    "@nestjs/common": "^10.0.0",
    "@nestjs/config": "^3.0.0",
    "@nestjs/core": "^10.0.0",
    "@nestjs/platform-express": "^10.0.0",
    "cache-manager": "5.2.3",
    "cache-manager-redis-yet": "4.1.2",
    "reflect-metadata": "^0.1.13",
    "rxjs": "^7.8.1"

Node.js version

16.20

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

The same behaviour happens for latest node and nestjs versions

@Pho3niX90 Pho3niX90 added the needs triage This issue has not been looked into label Jul 14, 2023
@quangtran88
Copy link
Contributor

Hi @Pho3niX90, according to the document, it appears that the impact is limited to methods. However, for further enhancement, I believe it would be beneficial to extend the support to the controller level as well.

image

@kamilmysliwiec
Copy link
Member

Let's track this here nestjs/cache-manager#112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into
Projects
None yet
Development

No branches or pull requests

3 participants