diff options
author | Markus Doits <markus.doits@stellenticket.de> | 2018-09-15 14:39:55 +0300 |
---|---|---|
committer | Markus Doits <markus.doits@stellenticket.de> | 2018-11-07 15:00:38 +0300 |
commit | 473b52b2837bfffc634f574f148d949e218137ed (patch) | |
tree | e63cda26538ddfe356334b30771f9511bb3ed706 /app/models | |
parent | d71a779740d1f667892e9bef798961e2a39a3a9c (diff) |
add an option when to retry a build (unused yet)
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/ci/build.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 09b03278939..b133c756fcf 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -324,6 +324,11 @@ module Ci retries.is_a?(Hash) && retries.fetch(:max, 0) || retries || 0 end + def retry_when + retries = self.options[:retry] + retries.is_a?(Hash) && retries.fetch(:when, 'always').to_s || 'always' + end + def latest? !retried? end |