diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /app/models/active_session.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'app/models/active_session.rb')
-rw-r--r-- | app/models/active_session.rb | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/app/models/active_session.rb b/app/models/active_session.rb index 7dbc95c251b..b16c4a2b353 100644 --- a/app/models/active_session.rb +++ b/app/models/active_session.rb @@ -83,24 +83,26 @@ class ActiveSession is_impersonated: request.session[:impersonator_id].present? ) - redis.pipelined do |pipeline| - pipeline.setex( - key_name(user.id, session_private_id), - expiry, - active_user_session.dump - ) - - # Deprecated legacy format - temporary to support mixed deployments - pipeline.setex( - key_name_v1(user.id, session_private_id), - expiry, - Marshal.dump(active_user_session) - ) - - pipeline.sadd( - lookup_key_name(user.id), - session_private_id - ) + Gitlab::Instrumentation::RedisClusterValidator.allow_cross_slot_commands do + redis.pipelined do |pipeline| + pipeline.setex( + key_name(user.id, session_private_id), + expiry, + active_user_session.dump + ) + + # Deprecated legacy format - temporary to support mixed deployments + pipeline.setex( + key_name_v1(user.id, session_private_id), + expiry, + Marshal.dump(active_user_session) + ) + + pipeline.sadd?( + lookup_key_name(user.id), + session_private_id + ) + end end end end @@ -298,7 +300,7 @@ class ActiveSession session_ids_and_entries.each do |session_id, entry| next if entry - pipeline.srem(lookup_key, session_id) + pipeline.srem?(lookup_key, session_id) removed << session_id end end |