Commit 0abce36c authored by Matija Čupić's avatar Matija Čupić

Update list of allowed attribute updates in Runner

parent 053b9d21
...@@ -68,8 +68,8 @@ module Ci ...@@ -68,8 +68,8 @@ module Ci
ONLINE_CONTACT_TIMEOUT.ago ONLINE_CONTACT_TIMEOUT.ago
end end
def contacted_at def name
cached_attribute(:contacted_at) || read_attribute(:contacted_at) cached_attribute(:name) || read_attribute(:name)
end end
def version def version
...@@ -80,10 +80,18 @@ module Ci ...@@ -80,10 +80,18 @@ module Ci
cached_attribute(:revision) || read_attribute(:revision) cached_attribute(:revision) || read_attribute(:revision)
end end
def platform
cached_attribute(:platform) || read_attribute(:platform)
end
def architecture def architecture
cached_attribute(:architecture) || read_attribute(:architecture) cached_attribute(:architecture) || read_attribute(:architecture)
end end
def contacted_at
cached_attribute(:contacted_at) || read_attribute(:contacted_at)
end
def set_default_values def set_default_values
self.token = SecureRandom.hex(15) if self.token.blank? self.token = SecureRandom.hex(15) if self.token.blank?
end end
...@@ -170,7 +178,7 @@ module Ci ...@@ -170,7 +178,7 @@ module Ci
end end
def update_cached_info(values) 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 values[:contacted_at] = Time.now
cache_attributes(values) cache_attributes(values)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment