From a3637de063ecb018c7d3d7a89ecb2f151c3ce662 Mon Sep 17 00:00:00 2001 From: fatkodima Date: Fri, 11 Oct 2024 02:29:28 +0300 Subject: [PATCH] Add sidekiq swarm integration --- lib/coverband.rb | 1 + lib/coverband/integrations/sidekiq_swarm.rb | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 lib/coverband/integrations/sidekiq_swarm.rb diff --git a/lib/coverband.rb b/lib/coverband.rb index f7b82289..f544986c 100644 --- a/lib/coverband.rb +++ b/lib/coverband.rb @@ -117,6 +117,7 @@ def self.runtime_coverage! start end require "coverband/integrations/resque" if defined? ::Resque + require "coverband/integrations/sidekiq_swarm" if defined? ::Sidekiq::Enterprise::Swarm rescue Redis::CannotConnectError => error Coverband.configuration.logger.info "Redis is not available (#{error}), Coverband not configured" Coverband.configuration.logger.info "If this is a setup task like assets:precompile feel free to ignore" diff --git a/lib/coverband/integrations/sidekiq_swarm.rb b/lib/coverband/integrations/sidekiq_swarm.rb new file mode 100644 index 00000000..0b2ba549 --- /dev/null +++ b/lib/coverband/integrations/sidekiq_swarm.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +Sidekiq.configure_server do |config| + config.on(:fork) do + Coverband.start + Coverband.runtime_coverage! + end +end