diff options
author | Paul Charlton <techguru@byiq.com> | 2017-07-11 06:35:47 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-07-11 06:35:47 +0300 |
commit | cb3b4a15e6913bc28ee2ecaab017a4c3f08c438e (patch) | |
tree | dc3915aa94508d76df2480a8e26ec4b33797a320 /lib/gitlab/lfs_token.rb | |
parent | 4daa6da5407d235cbe4f7a787eaa29304446a870 (diff) |
Support multiple Redis instances based on queue type
Diffstat (limited to 'lib/gitlab/lfs_token.rb')
-rw-r--r-- | lib/gitlab/lfs_token.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/lfs_token.rb b/lib/gitlab/lfs_token.rb index 5f67e97fa2a..8e57ba831c5 100644 --- a/lib/gitlab/lfs_token.rb +++ b/lib/gitlab/lfs_token.rb @@ -18,10 +18,10 @@ module Gitlab end def token - Gitlab::Redis.with do |redis| - token = redis.get(redis_key) + Gitlab::Redis::SharedState.with do |redis| + token = redis.get(redis_shared_state_key) token ||= Devise.friendly_token(TOKEN_LENGTH) - redis.set(redis_key, token, ex: EXPIRY_TIME) + redis.set(redis_shared_state_key, token, ex: EXPIRY_TIME) token end @@ -41,7 +41,7 @@ module Gitlab private - def redis_key + def redis_shared_state_key "gitlab:lfs_token:#{actor.class.name.underscore}_#{actor.id}" if actor end end |