Sha256: 53523c4e1e77e14e507528d8878c4dd692d55340bed5f8942a3bfe45fbde8297

Contents?: true

Size: 711 Bytes

Versions: 10

Compression:

Stored size: 711 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 release!
        # noop
      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

10 entries across 10 versions & 1 rubygems

Version Path
ci-queue-0.26.0 lib/ci/queue/common.rb
ci-queue-0.25.0 lib/ci/queue/common.rb
ci-queue-0.24.3 lib/ci/queue/common.rb
ci-queue-0.24.2 lib/ci/queue/common.rb
ci-queue-0.24.1 lib/ci/queue/common.rb
ci-queue-0.24.0 lib/ci/queue/common.rb
ci-queue-0.23.1 lib/ci/queue/common.rb
ci-queue-0.23.0 lib/ci/queue/common.rb
ci-queue-0.22.1 lib/ci/queue/common.rb
ci-queue-0.22.0 lib/ci/queue/common.rb