Sha256: 77de3aed1dfc87fc057eff1baca6295046504b02fa82dd1c6d8b7fb145bffaa4

Contents?: true

Size: 482 Bytes

Versions: 6

Compression:

Stored size: 482 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.skip_services?

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
workarea-core-3.5.27 lib/workarea/scheduled_jobs.rb
workarea-core-3.5.26 lib/workarea/scheduled_jobs.rb
workarea-core-3.5.25 lib/workarea/scheduled_jobs.rb
workarea-core-3.5.23 lib/workarea/scheduled_jobs.rb
workarea-core-3.5.22 lib/workarea/scheduled_jobs.rb
workarea-core-3.5.21 lib/workarea/scheduled_jobs.rb