diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-02-28 12:07:04 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-03-03 12:57:47 +0100 |
commit | 2b27a98db32d788796c4495f5405ba09436fd8ce (patch) | |
tree | 117472736dba3c4978aa30f8cee5cba3873b5bcb /app | |
parent | 859a9cd9a65a2b862145efafd8716613fda29cd7 (diff) | |
download | gitlab-ce-2b27a98db32d788796c4495f5405ba09436fd8ce.tar.gz |
Add support for Workhorse notifications
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/runner.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index 4863c34a6a6..34ffc4b77fc 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -127,17 +127,16 @@ module Ci def tick_runner_queue SecureRandom.hex.tap do |new_update| - Gitlab::Redis.with do |redis| - redis.set(runner_queue_key, new_update, ex: RUNNER_QUEUE_EXPIRY_TIME) - end + ::Gitlab::Workhorse.ensure_and_notify(runner_queue_key, new_update, + expire: RUNNER_QUEUE_EXPIRY_TIME, overwrite: true) end end def ensure_runner_queue_value Gitlab::Redis.with do |redis| - value = SecureRandom.hex - redis.set(runner_queue_key, value, ex: RUNNER_QUEUE_EXPIRY_TIME, nx: true) - redis.get(runner_queue_key) + new_value = SecureRandom.hex + ::Gitlab::Workhorse.ensure_and_notify(runner_queue_key, new_value, + expire: RUNNER_QUEUE_EXPIRY_TIME, overwrite: false) end end |