I am creating a delayed job in my controller using the delay method as below:
JobProcessor.delay(:run_at => Time.now).process_job(options)
Now inside the process_job method I am doing
chunks = options[:collection].each_splice(10).to_a
chunks.each do |chunk|
self.delay(:run_at => Time.now).chunk_job
end
This is giving me error stack level too deep when I send request to the URL
What might be the issue? Please help.
I was able to make it work for me by doing some changes.
process_jobto be an instance methodSo now my code looks like
in the controller, and inside the
JobProcessorclass I haveThis works for me.