redis not setting expire time
ginogf
PROOP

2 years ago

hi, i have a redis instance in a project that is not setting the ttl when setting value in the cachehere's an example of my code

await this.cache.set(phoneNumber, conversationState, 7200000); // 2 hours expiration

i'm using nestjs with "@nestjs/cache-manager": "^2.2.2"

Solved

7 Replies

brody
EMPLOYEE

2 years ago

How have you verified that the TTL isn't being set?


ginogf
PROOP

2 years ago

in railway's dashboard → redis instance → data, keys have "no expiry" and via redis-cli connecting to the instance deployed in railway. i also then tested by setting and expire second in the railway's dasboard and the checking if there was a TTL for that key via redis-cli and it had. then runned in my local env with a local redis instance, checked the keys via redis-cli, also TTL was correctly set


ginogf
PROOP

2 years ago

dashboard capture

Attachments


brody
EMPLOYEE

2 years ago

Please take what the data tab says with a grain of salt.

How have you verified that no TTL is being set without the use of the data tab?


ginogf
PROOP

2 years ago

Please take what the data tab says with a grain of salt.

How have you verified that no TTL is being set without the use of the data tab?

thanks, as i said i also checked that no TTL is being set by connecting to the redis instance deployed in railway via my terminal


brody
EMPLOYEE

2 years ago

That would indicate an issue with the caching library that's talking to redis, check on it's GitHub repo, maybe other people have experienced the same.


Status changed to Solved Railway over 1 year ago


ginogf
PROOP

2 years ago

not the case, but thanks for your help


Loading...