lib/rocket_job/plugins/job/throttle.rb in rocketjob-6.0.0.rc1 vs lib/rocket_job/plugins/job/throttle.rb in rocketjob-6.0.0.rc2

- old
+ new

@@ -46,19 +46,19 @@ # Default: :throttle_filter_class (Throttle all jobs of this class) # # Note: Throttles are executed in the order they are defined. def define_throttle(method_name, filter: :throttle_filter_class) # Duplicate to prevent modifying parent class throttles - definitions = rocket_job_throttles ? rocket_job_throttles.dup : ThrottleDefinitions.new + definitions = rocket_job_throttles ? rocket_job_throttles.deep_dup : ThrottleDefinitions.new definitions.add(method_name, filter) self.rocket_job_throttles = definitions end # Undefine a previously defined throttle def undefine_throttle(method_name) return unless rocket_job_throttles - definitions = rocket_job_throttles.dup + definitions = rocket_job_throttles.deep_dup definitions.remove(method_name) self.rocket_job_throttles = definitions end # Has a throttle been defined?