Sha256: e3ca782784e61a692291e6179e6ccd8356ca3cd5759635069a072cce30465b00

Contents?: true

Size: 499 Bytes

Versions: 56

Compression:

Stored size: 499 Bytes

Contents

module Workarea
  module ScheduledJobs
    # Remove any scheduled jobs that still exist in Redis, but no longer
    # have a worker class available for them. Fixes an issue wherein
    # removing a previously scheduled job from initializers doesn't
    # actually stop the job from being enqueued.
    def self.clean
      return if Workarea.config.skip_service_connections

      Sidekiq::Cron::Job.all.each do |job|
        job.destroy unless const_defined?(job.klass)
      end
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
workarea-core-3.4.45 lib/workarea/scheduled_jobs.rb
workarea-core-3.4.44 lib/workarea/scheduled_jobs.rb
workarea-core-3.4.43 lib/workarea/scheduled_jobs.rb
workarea-core-3.4.42 lib/workarea/scheduled_jobs.rb
workarea-core-3.5.20 lib/workarea/scheduled_jobs.rb
workarea-core-3.4.41 lib/workarea/scheduled_jobs.rb
workarea-core-3.5.19 lib/workarea/scheduled_jobs.rb
workarea-core-3.4.40 lib/workarea/scheduled_jobs.rb
workarea-core-3.5.18 lib/workarea/scheduled_jobs.rb
workarea-core-3.4.39 lib/workarea/scheduled_jobs.rb
workarea-core-3.5.17 lib/workarea/scheduled_jobs.rb
workarea-core-3.4.38 lib/workarea/scheduled_jobs.rb
workarea-core-3.5.16 lib/workarea/scheduled_jobs.rb
workarea-core-3.4.37 lib/workarea/scheduled_jobs.rb
workarea-core-3.5.15 lib/workarea/scheduled_jobs.rb
workarea-core-3.4.36 lib/workarea/scheduled_jobs.rb
workarea-core-3.5.14 lib/workarea/scheduled_jobs.rb
workarea-core-3.4.35 lib/workarea/scheduled_jobs.rb
workarea-core-3.5.13 lib/workarea/scheduled_jobs.rb
workarea-core-3.4.34 lib/workarea/scheduled_jobs.rb