Subject: | Store subroutine expiration is not working properly |
Date: | Sat, 30 Jun 2012 11:21:41 -0500 |
To: | bug-CHI-Driver-Redis [...] rt.cpan.org |
From: | James M <mess1214 [...] gmail.com> |
I noticed that when creating a CHI object using the Redis driver, with expires_on_backend set to 1, all cache entries were expiring immediately. I was setting expirations for keys using the expires_in argument.
When debugging, I noticed that in CHI::Driver::Redis::store(), the argument you have named $expires_at (and expecting an epoch time) is actually the expires_in value (in seconds). I believe that variable should be renamed to $expires_in, and then instead of converting to $secs, you just need $self->redis->expire($realkey, $expires_in);