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/user_activities.rb | |
parent | 4daa6da5407d235cbe4f7a787eaa29304446a870 (diff) |
Support multiple Redis instances based on queue type
Diffstat (limited to 'lib/gitlab/user_activities.rb')
-rw-r--r-- | lib/gitlab/user_activities.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/user_activities.rb b/lib/gitlab/user_activities.rb index eb36ab9fded..125488536e1 100644 --- a/lib/gitlab/user_activities.rb +++ b/lib/gitlab/user_activities.rb @@ -6,13 +6,13 @@ module Gitlab BATCH_SIZE = 500 def self.record(key, time = Time.now) - Gitlab::Redis.with do |redis| + Gitlab::Redis::SharedState.with do |redis| redis.hset(KEY, key, time.to_i) end end def delete(*keys) - Gitlab::Redis.with do |redis| + Gitlab::Redis::SharedState.with do |redis| redis.hdel(KEY, keys) end end @@ -21,7 +21,7 @@ module Gitlab cursor = 0 loop do cursor, pairs = - Gitlab::Redis.with do |redis| + Gitlab::Redis::SharedState.with do |redis| redis.hscan(KEY, cursor, count: BATCH_SIZE) end |