Sha256: 2f504cca350a0d308b6e2c85321281df2ce75f50ac3e86d75cb55650f1cce98d

Contents?: true

Size: 582 Bytes

Versions: 10

Compression:

Stored size: 582 Bytes

Contents

module Resque
  class SettingNotFound < RuntimeError; end

  class ThrottledJob

    THROTTLE_DEFAULTS = {
        :can_run_every => 1800,
        :disabled      => false,
    }

    def self.settings
      @settings ||= THROTTLE_DEFAULTS.dup
    end

    def self.throttle(args = {})
      settings.merge!(args)
    end

    def self.identifier(*args)
    end

    def self.key(*args)
      [self.to_s, identifier(*args)].compact.join(":")
    end

    def self.can_run_every
      settings[:can_run_every]
    end

    def self.disabled
      settings[:disabled]
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
resque-throttle-0.3.0 lib/resque/throttled_job.rb
tech-angels-resque-throttle-0.2.20 lib/resque/throttled_job.rb
resque-throttle-0.2.19 lib/resque/throttled_job.rb
resque-throttle-0.2.18 lib/resque/throttled_job.rb
resque-throttle-0.2.17 lib/resque/throttled_job.rb
resque-throttle-0.2.16 lib/resque/throttled_job.rb
resque-throttle-0.2.15 lib/resque/throttled_job.rb
resque-throttle-0.2.14 lib/resque/throttled_job.rb
resque-throttle-0.2.13 lib/resque/throttled_job.rb
resque-throttle-0.2.11 lib/resque/throttled_job.rb