quirkey/resque-status

Expiring status keys not working?

bkosborne opened this issue · 2 comments

It looks like the # of keys in redis increases without end, constantly filling with resque-status keys.

I'm using Rails 3.x, and I have in an initializer the following:

Resque::Plugins::Status::Hash.expire_in = (60 * 60)

It seems like it's working, as when I look at http://myapp.inc/resque/statuses, and browse to the last page of statuses, they are only there for the past hour.

However, when looking at the redis keys directly, there are tens of thousands of keys that look like this:

status:c29d66b0b7c4012fb5d952540035c270

I assume that is Resque status?

Do I have something misconfigured where the keys are not being removed?

We've had this running in production for a long time and haven't seen this build up. It could be a setting on the redis side of when to actually purge expired keys? Have you tried checking the TTL or contents of any of these? Are they recent? Very old?

Sorry about that - turns out that the workers that were using resque-status were not operating in a rails environment (intentionally, they don't need to). The initializer didn't matter in this case. I put the expire code in the job itself and it's working just as I expected. Great plugin, thanks.