Giter Site home page Giter Site logo

Comments (4)

teeparham avatar teeparham commented on May 18, 2024

How is your CounterCacheJob configured?

from resque_solo.

rhymes avatar rhymes commented on May 18, 2024

@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

from resque_solo.

teeparham avatar teeparham commented on May 18, 2024

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, resque_solo will check the queue and either enqueue the job or not. I don't think there's any issue with this gem. If you want to prevent scheduling duplicate jobs, that's up to whatever you're using to schedule jobs.

from resque_solo.

rhymes avatar rhymes commented on May 18, 2024

@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 :)

from resque_solo.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.