module Sidekiq module CircuitBreaker module Scope def extract_scope(worker_class_name, msg, options) from_setup = begin scope = options.scope return scope if scope.is_a?(String) return unless scope.respond_to?(:call) options.scope.call(*msg['args']) end from_setup || worker_class_name end end end end