Sha256: f4d5c46016f50b8453a115444f62d882036c6bed1521dbafc7cf17ddb17065f0

Contents?: true

Size: 666 Bytes

Versions: 17

Compression:

Stored size: 666 Bytes

Contents

# frozen_string_literal: true
module CI
  module Queue
    module Common
      attr_reader :config

      # to override in classes including this module
      CONNECTION_ERRORS = [].freeze

      def retrying?
        false
      end

      def flaky?(test)
        @config.flaky?(test)
      end

      def report_failure!
        config.circuit_breakers.each(&:report_failure!)
      end

      def report_success!
        config.circuit_breakers.each(&:report_success!)
      end

      def rescue_connection_errors(handler = ->(err) { nil })
        yield
      rescue *self::class::CONNECTION_ERRORS => err
        handler.call(err)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ci-queue-0.21.1 lib/ci/queue/common.rb
ci-queue-0.21.0 lib/ci/queue/common.rb
ci-queue-0.20.9 lib/ci/queue/common.rb
ci-queue-0.20.8 lib/ci/queue/common.rb
ci-queue-0.20.7 lib/ci/queue/common.rb
ci-queue-0.20.6 lib/ci/queue/common.rb
ci-queue-0.20.5 lib/ci/queue/common.rb
ci-queue-0.20.4 lib/ci/queue/common.rb
ci-queue-0.20.3 lib/ci/queue/common.rb
ci-queue-0.20.2 lib/ci/queue/common.rb
ci-queue-0.20.1 lib/ci/queue/common.rb
ci-queue-0.20.0 lib/ci/queue/common.rb
ci-queue-0.19.0 lib/ci/queue/common.rb
ci-queue-0.18.0 lib/ci/queue/common.rb
ci-queue-0.17.2 lib/ci/queue/common.rb
ci-queue-0.17.1 lib/ci/queue/common.rb
ci-queue-0.17.0 lib/ci/queue/common.rb