diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-01-29 23:00:39 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-01-29 23:00:39 +0100 |
commit | 3be6f68a33d163922a78c51928980efc57a3efb5 (patch) | |
tree | d40b956a044a4b97ae1b4b091ac4e6687137d4b7 /spec/models | |
parent | b88103e4075678d032d7d7350caaece4a3091328 (diff) | |
download | gitlab-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 'spec/models')
-rw-r--r-- | spec/models/ci/runner_spec.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index 14747a23c82..99b4a82da88 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -128,6 +128,7 @@ describe Ci::Runner do context 'with cache value' do context 'contacted long time ago time' do before do + runner.contacted_at = 1.year.ago stub_redis_runner_contacted_at(1.year.ago.to_s) end @@ -136,6 +137,7 @@ describe Ci::Runner do context 'contacted 1s ago' do before do + runner.contacted_at = 50.minutes.ago stub_redis_runner_contacted_at(1.second.ago.to_s) end |