diff options
author | Markus Doits <markus.doits@stellenticket.de> | 2018-10-19 16:47:18 +0200 |
---|---|---|
committer | Markus Doits <markus.doits@stellenticket.de> | 2018-11-07 13:04:43 +0100 |
commit | 9818bb561889579ed1031e90b7879ec1c3f0e25a (patch) | |
tree | 445a085e087644243d8e67f1bb22d04c63abcf57 /app/models | |
parent | ff3484a0b331456b36f82b0d6cda2afd56da566e (diff) | |
download | gitlab-ce-9818bb561889579ed1031e90b7879ec1c3f0e25a.tar.gz |
refactoring after latest feedback
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/ci/build.rb | 8 |
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? |