debasishg / scala-redis

A scala library for connecting to a redis server, or a cluster of redis nodes using consistent hashing on the client side.
1.02k stars 219 forks source link

Specify TTL for a key before pushing to Redis #268

Closed ShreyasTandale closed 3 years ago

ShreyasTandale commented 3 years ago

Hi, Is there a way to specify a TTL for a key before I push to redis? I am pushing a list into REDIS something like this = redisClient.lpush(key, value)

ShreyasTandale commented 3 years ago

This was simple. val _redisMasterClient = new RedisClient(redisMasterUrl, 6379) _redisMasterClient.expire(key, TTL)

Marking this closed.