resque / resque-scheduler

A light-weight job scheduling system built on top of Resque
MIT License
1.74k stars 481 forks source link

Cleaning up the scheduled jobs #458

Open rafael opened 9 years ago

rafael commented 9 years ago

Hello all -

I have a question regarding how the scheduled jobs are clean up from redis. I was looking at this code: https://github.com/resque/resque-scheduler/blob/6e86834e9ff35fb9e976ab79176b650f19385562/lib/resque/scheduler/delaying_extensions.rb#L114

I'm seeing some huge discrepancies in redis between the size of resque:delayed_queue_schedule and the amount of "resque:delayed:1419022315" and "resque:timestamps:.." .

I was thinking if it possible that some jobs didn't get clean properly. What happens if an exception is thrown in this part of the code?

Is there a way to clean up timestamps that are older than x ?

carsonreinke commented 8 years ago

@rafael are you still seeing these excess keys a lot?

I don't see why this could not be simply a ZSET with the score as the timestamp and the member the job.