nickelser / activejob-traffic_control

Rate limiting/job enabling for ActiveJob using distributed locks in Redis or Memcached.
305 stars 28 forks source link

disable! & enable! job perpetually stuck #16

Open mr-romeijn opened 4 years ago

mr-romeijn commented 4 years ago

How is enable! and disable! supposed to work?

I'm using sidekiq and check a certain condition throughout the execution of the job and disable or enable it based ons said condition. However the job seems to get perpetually stuck in a planned state.

I'm using memory_store as cache client.

ActiveJob::TrafficControl.cache_client = ActiveSupport::Cache.lookup_store(:memory_store)

code managing the state:

Job.disable! unless @asset.ready?
Job.enable!  if     @asset.ready?