Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call encode once to remove the possibility of different encoded job values. #599

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kamaljoshi
Copy link

@kamaljoshi kamaljoshi commented Feb 13, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants