Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

Fetch keys which are older than 10 days from redis

$
0
0

I am trying to fetch the keys from Redis which are older than 10 days. I am using Zrange to fetch the old keys which are saved based on timestamp. I am getting this error when I run the last command ERR value is not an integer or out of range.Any help is appreciated or can someone guide me if I am doing wrong way

These are the values/timestamp I have used while adding in redis

Time.current.to_i => 1676960645(Time.current - 3.days).to_i => 1676701452(Time.current - 13.days).to_i => 1675837471(Time.current - 10.days).to_i => 1676096682redis-cli127.0.0.1:6379> ZADD myzset 1676960645 "current"(integer) 1127.0.0.1:6379> ZADD myzset 1676701452 "3 days ago"(integer) 1127.0.0.1:6379> ZADD myzset 1675837471 "13 days ago"(integer) 1127.0.0.1:6379> ZRANGE myzset )1676096682 1676960645(error) ERR value is not an integer or out of range127.0.0.1:6379> 

Version:

redis-cli -v
redis-cli 4.0.9


Viewing all articles
Browse latest Browse all 873

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>