summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-01-29 23:00:39 +0100
committerMatija Čupić <matteeyah@gmail.com>2018-01-29 23:00:39 +0100
commit3be6f68a33d163922a78c51928980efc57a3efb5 (patch)
treed40b956a044a4b97ae1b4b091ac4e6687137d4b7 /app
parentb88103e4075678d032d7d7350caaece4a3091328 (diff)
downloadgitlab-ce-3be6f68a33d163922a78c51928980efc57a3efb5.tar.gz
Make Ci::Runner#online? slightly more performant
This is a small refactor to avoid querying Redis when we know there's nothing in it.
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/runner.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb
index 7cf36c0bfe0..f6d51fabd69 100644
--- a/app/models/ci/runner.rb
+++ b/app/models/ci/runner.rb
@@ -97,7 +97,7 @@ module Ci
end
def online?
- cached_contacted_at && cached_contacted_at > self.class.contact_time_deadline
+ contacted_at && cached_contacted_at > self.class.contact_time_deadline
end
def status