summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/build.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 08d6e669cf9..7b220487495 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -318,15 +318,11 @@ module Ci
end
def retries_max
- retries = self.options[:retry]
- retries.is_a?(Hash) && retries.fetch(:max, 0) || retries || 0
+ options&.dig(:retry, :max) || 0
end
def retry_when
- retries = self.options[:retry]
- Array.wrap(
- retries.is_a?(Hash) && retries.fetch(:when, 'always') || 'always'
- )
+ options&.dig(:retry, :when) || ['always']
end
def retry_failure?