redis not setting expire time

ginogf
PRO

a year 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

a year ago

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


ginogf
PRO

a year 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
PRO

a year ago

dashboard capture

Attachments


a year 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
PRO

a year 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


a year 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[bot] about 1 year ago


ginogf
PRO

a year ago

not the case, but thanks for your help