resque-scheduler
resque-scheduler copied to clipboard
Call encode once to remove the possibility of different encoded job values.
This fixes the non cleanup of Resque scheduled sets where the encoded job in the scheduled list and job set were different. In our setup because of the encoded keys being different, there were orphan sets in Redis for which job had already been processed. It led to Redis memory consumption increasing continuously.
A simple example to reproduce this would be to pass the foo object(from the class described below) as the argument to resque job.
class Foo
def as_json _options = {}
{
generated_at: Time.now.to_f
}
end
end
foo = Foo.new
Resque.encode foo
I didn't feel the need to add this type of job in the test but tell me if I need to update the tests as well.