Open mkasztelnik opened 8 years ago
For start I propose to test until_executing
strategy. It should be enough to solve our problems with too many the same jobs scheduled.
@nowakowski, @tbartynski, @Nuanda any comment on that?
Seems like this would fix our issue. I'm for.
Does a code that tries to schedule a job that is already scheduled get a success response, even though the new job was not scheduled, since it's a repetition? In other words, does one need to change the code that schedules jobs, to account for jobs not being scheduled?
@Nuanda I don't think that scheduling code need to be changed, but my knowledge is based only on gem documentation - we need to test it.
I think it's worth trying. Let's do it!
I was checking 2 strategies: until_executing
and until_and_while_executing
(see https://github.com/dice-cyfronet/atmosphere/compare/unique-jobs). Unfortunately without success. Most probably I'm doing something stupidly wrong...
My testing setup was to push this branch into vph-dev, log in into rails console end execute:
100.times { Atmosphere::HttpMappingMonitoringWorker.perform_at(20.seconds.from_now, :ok) }
As a result 100 HttpMappingMonitoringWorkers
were created and executed after 20 seconds :cry:
Any idea/proposition what I'm doing wrong?
Currently if monitoring job takes long time there can be a situation when many monitoring delayed jobs are created. This gem can solve this issue: https://github.com/mhenrixon/sidekiq-unique-jobs - we should investigate it in spare time.