diff options
-rw-r--r-- | app/models/ci/runner.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index 9749e019d3c..5711be3ae29 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -68,8 +68,8 @@ module Ci ONLINE_CONTACT_TIMEOUT.ago end - def contacted_at - cached_attribute(:contacted_at) || read_attribute(:contacted_at) + def name + cached_attribute(:name) || read_attribute(:name) end def version @@ -80,10 +80,18 @@ module Ci cached_attribute(:revision) || read_attribute(:revision) end + def platform + cached_attribute(:platform) || read_attribute(:platform) + end + def architecture cached_attribute(:architecture) || read_attribute(:architecture) end + def contacted_at + cached_attribute(:contacted_at) || read_attribute(:contacted_at) + end + def set_default_values self.token = SecureRandom.hex(15) if self.token.blank? end @@ -170,7 +178,7 @@ module Ci end def update_cached_info(values) - values = values.slice(:version, :revision, :platform, :architecture) + values = values&.slice(:name, :version, :revision, :platform, :architecture) || {} values[:contacted_at] = Time.now cache_attributes(values) |