lib/sidekiq/throttled/web.rb in sidekiq-throttled-0.7.0 vs lib/sidekiq/throttled/web.rb in sidekiq-throttled-0.7.1
- old
+ new
@@ -8,10 +8,11 @@
require "sidekiq/web"
# internal
require "sidekiq/throttled/registry"
require "sidekiq/throttled/web/stats"
+require "sidekiq/throttled/web/summary_fix"
module Sidekiq
module Throttled
# Provides Sidekiq tab to monitor and reset throttled stats.
module Web
@@ -20,24 +21,27 @@
QUEUES_TPL = VIEWS.join("queues.html.erb").read.freeze
class << self
# Replace default Queues tab with enhanced one.
def enhance_queues_tab!
+ SummaryFix.enabled = true
Sidekiq::Web::DEFAULT_TABS["Queues"] = "enhanced-queues"
Sidekiq::Web.tabs.delete("Enhanced Queues")
end
# Restore original Queues tab.
#
# @api There's next to absolutely no value in this method for real
# users. The only it's purpose is to restore virgin state in specs.
def restore_queues_tab!
+ SummaryFix.enabled = false
Sidekiq::Web::DEFAULT_TABS["Queues"] = "queues"
Sidekiq::Web.tabs["Enhanced Queues"] = "enhanced-queues"
end
# @api private
def registered(app)
+ app.send(:include, SummaryFix)
register_throttled_tab app
register_enhanced_queues_tab app
end
private