lib/sidekiq/throttled/job.rb in sidekiq-throttled-1.5.0 vs lib/sidekiq/throttled/job.rb in sidekiq-throttled-1.5.1
- old
+ new
@@ -22,12 +22,10 @@
# end
# end
#
# @see ClassMethods
module Job
- VALID_VALUES_FOR_REQUEUE_WITH = %i[enqueue schedule].freeze
-
# Extends worker class with {ClassMethods}.
#
# @note Using `included` hook with extending worker with {ClassMethods}
# in order to make API inline with `include Sidekiq::Job`.
#
@@ -89,16 +87,9 @@
#
# @param [Hash] requeue What to do with jobs that are throttled
# @see Registry.add
# @return [void]
def sidekiq_throttle(**kwargs)
- requeue_options = Throttled.config.default_requeue_options.merge(kwargs.delete(:requeue) || {})
- unless VALID_VALUES_FOR_REQUEUE_WITH.include?(requeue_options[:with])
- raise ArgumentError, "requeue: #{requeue_options[:with]} is not a valid value for :with"
- end
-
- self.sidekiq_throttled_requeue_options = requeue_options
-
Registry.add(self, **kwargs)
end
# Adds current worker to preconfigured throttling strategy. Allows
# sharing same pool for multiple workers.