lib/sidekiq/throttled/web/stats.rb in sidekiq-throttled-0.1.0 vs lib/sidekiq/throttled/web/stats.rb in sidekiq-throttled-0.2.0
- old
+ new
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
module Sidekiq
module Throttled
module Web
# Throttle strategy stats generation helper
# @private
@@ -11,9 +12,12 @@
[1, "second", "seconds"]
].freeze
# @param [Strategy::Concurrency, Strategy::Threshold] strategy
def initialize(strategy)
+ if strategy && strategy.dynamic_keys?
+ raise ArgumentError, "Can't handle strategies with dynamic keys"
+ end
@strategy = strategy
end
# @return [String]
def to_html