From 9818bb561889579ed1031e90b7879ec1c3f0e25a Mon Sep 17 00:00:00 2001 From: Markus Doits Date: Fri, 19 Oct 2018 16:47:18 +0200 Subject: refactoring after latest feedback --- app/models/ci/build.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'app/models') 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? -- cgit v1.2.1