Class: Gitlab::Ci::Build::AutoRetry

Inherits:
Object
  • Object
show all
Includes:
Utils::StrongMemoize
Defined in:
lib/gitlab/ci/build/auto_retry.rb

Constant Summary collapse

DEFAULT_RETRIES =
{
  scheduler_failure: 2
}.freeze

Instance Method Summary collapse

Methods included from Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Constructor Details

#initialize(build) ⇒ AutoRetry

Returns a new instance of AutoRetry.


10
11
12
# File 'lib/gitlab/ci/build/auto_retry.rb', line 10

def initialize(build)
  @build = build
end

Instance Method Details

#allowed?Boolean

Returns:

  • (Boolean)

14
15
16
17
18
# File 'lib/gitlab/ci/build/auto_retry.rb', line 14

def allowed?
  return false unless @build.retryable?

  within_max_retry_limit?
end