lib/sidekiq/expected_failures.rb in sidekiq-expected_failures-0.2.1 vs lib/sidekiq/expected_failures.rb in sidekiq-expected_failures-0.2.2

- old
+ new

@@ -1,6 +1,10 @@ -require "sidekiq/web" +begin + require "sidekiq/web" + rescue LoadError +end + require "sidekiq/expected_failures/version" require "sidekiq/expected_failures/middleware" require "sidekiq/expected_failures/web" module Sidekiq @@ -53,11 +57,13 @@ end end end end -Sidekiq::Web.register Sidekiq::ExpectedFailures::Web -Sidekiq::Web.tabs["Expected Failures"] = "expected_failures" +if defined?(Sidekiq::Web) + Sidekiq::Web.register Sidekiq::ExpectedFailures::Web + Sidekiq::Web.tabs["Expected Failures"] = "expected_failures" +end Sidekiq.configure_server do |config| config.server_middleware do |chain| chain.add Sidekiq::ExpectedFailures::Middleware end