diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-03-21 17:34:55 +0100 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-03-28 13:58:35 +0200 |
commit | 7d7b0688b846e346a0799340875d459d26c1718d (patch) | |
tree | bc5fdca787ab89482e858169e92c78b3ea72d641 /app | |
parent | c747d9bc0b35d2982f45e2e8a0bdaa305f504f38 (diff) | |
download | gitlab-ce-7d7b0688b846e346a0799340875d459d26c1718d.tar.gz |
Add validation for max_timeout in Ci::Runner
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/runner.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index 62cc636db22..5a4c56ec0dc 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -54,6 +54,10 @@ module Ci chronic_duration_attr :maximum_timeout_human_readable, :maximum_timeout + validates :maximum_timeout, allow_nil: true, + numericality: { greater_than_or_equal_to: 600, + message: 'needs to be at least 10 minutes' } + # Searches for runners matching the given query. # # This method uses ILIKE on PostgreSQL and LIKE on MySQL. |