diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-01-20 14:16:13 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-01-20 14:16:13 +0100 |
commit | ecb9f978eba1f1693f30e36428f3ace9b59af1e7 (patch) | |
tree | c4bf413819ea9a2b0cdd419e47537a70289f5ab5 | |
parent | 10678525b0484ce5a06f643be2ce9f4fab2d4357 (diff) | |
download | gitlab-ce-ecb9f978eba1f1693f30e36428f3ace9b59af1e7.tar.gz |
Improve readability of runner tick queue method
-rw-r--r-- | app/models/ci/runner.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index 6e58a1878c8..ed1843ba005 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -126,9 +126,11 @@ module Ci end def tick_runner_queue - new_update = SecureRandom.hex - Gitlab::Redis.with { |redis| redis.set(runner_queue_key, new_update, ex: RUNNER_QUEUE_EXPIRY_TIME) } - new_update + SecureRandom.hex.tap do |new_update| + Gitlab::Redis.with do |redis| + redis.set(runner_queue_key, new_update, ex: RUNNER_QUEUE_EXPIRY_TIME) + end + end end def ensure_runner_queue_value |