-
Notifications
You must be signed in to change notification settings - Fork 16
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
resque_solo does not play well with scheduled jobs #11
Comments
How is your |
@teeparham sorry, I forgot to add that: class CounterCacheJob
include Resque::Plugins::UniqueJob
@queue = :counter_cache
# adapted from https://github.com/wanelo/counter-cache#default_worker_adapter
def self.perform(base_class, options)
options.symbolize_keys!
options[:source_object_class_name] = base_class.constantize
# options[:counter] is the class name of the counter that called the adapter
counter_class = options[:counter].constantize
counter = counter_class.new(nil, options)
counter.save!
end
end |
That looks like your job is configured OK. I suspect that the jobs are scheduled, but they are not enqueued until the scheduler runs. At that time, |
@teeparham I'm using https://github.com/resque/resque-scheduler - you're probably right, it makes sense because the scheduler can enqueue the jobs ONLY when they need to be executed I've also found this five year old thread about it resque/resque-scheduler#113 it seems there's no easy solution :) |
Hi,
I am using https://github.com/wanelo/counter-cache to schedule counting jobs that get enqueued automatically after a few actions. Unfortunately counter-cache is not smart in the sense that it doesn't detect if a job is already in the queue, hence why I started using resque_solo which works perfectly for "immediate" counting jobs, it does not work with schedule ones.
As you can see:
some of these jobs have the same signature and same timestamp. I'd argue that jobs with the same timestamp and signature should not be in the queue at the same time, correct?
Thank you
The text was updated successfully, but these errors were encountered: