summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2018-02-21 01:21:59 +0100
committerTomasz Maczukin <tomasz@maczukin.pl>2018-03-28 13:55:46 +0200
commitd633bc8134fe472137fb668c1eb78de45dc9bb57 (patch)
treed50c6d3a4bceb0bda5a20b05820bf9efb37b5b40 /app/models
parenta4ea9a93db98461479dcb8e1d7b8425a77018f1e (diff)
downloadgitlab-ce-d633bc8134fe472137fb668c1eb78de45dc9bb57.tar.gz
Rename job_upper_timeout to maximum_job_timeout
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/build.rb4
-rw-r--r--app/models/ci/runner.rb8
2 files changed, 6 insertions, 6 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index e15c4bc6ceb..61a0ef08dde 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -232,13 +232,13 @@ module Ci
end
def timeout
- return runner.job_upper_timeout if should_use_runner_timeout
+ return runner.maximum_job_timeout if should_use_runner_timeout
project.build_timeout
end
def should_use_runner_timeout
- runner && runner.defines_job_upper_timeout? && runner.job_upper_timeout < project.build_timeout
+ !runner.nil? && runner.defines_maximum_job_timeout? && runner.maximum_job_timeout < project.build_timeout
end
private :should_use_runner_timeout
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb
index cf91ed3c9dc..3d83e00ccfe 100644
--- a/app/models/ci/runner.rb
+++ b/app/models/ci/runner.rb
@@ -9,7 +9,7 @@ module Ci
ONLINE_CONTACT_TIMEOUT = 1.hour
UPDATE_DB_RUNNER_INFO_EVERY = 40.minutes
AVAILABLE_SCOPES = %w[specific shared active paused online].freeze
- FORM_EDITABLE = %i[description tag_list active run_untagged locked access_level job_upper_timeout].freeze
+ FORM_EDITABLE = %i[description tag_list active run_untagged locked access_level maximum_job_timeout_user_readable].freeze
has_many :builds
has_many :runner_projects, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
@@ -52,7 +52,7 @@ module Ci
cached_attr_reader :version, :revision, :platform, :architecture, :contacted_at, :ip_address
- chronic_duration_attribute :job_upper_timeout_user_readable, :job_upper_timeout
+ chronic_duration_attribute :maximum_job_timeout_user_readable, :maximum_job_timeout
# Searches for runners matching the given query.
#
@@ -170,8 +170,8 @@ module Ci
end
end
- def defines_job_upper_timeout?
- job_upper_timeout && job_upper_timeout > 0
+ def defines_maximum_job_timeout?
+ !maximum_job_timeout.nil? && maximum_job_timeout > 0
end
private