summaryrefslogtreecommitdiff
path: root/spec/support/helpers/session_helpers.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-17 16:05:49 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-17 16:05:49 +0000
commit43a25d93ebdabea52f99b05e15b06250cd8f07d7 (patch)
treedceebdc68925362117480a5d672bcff122fb625b /spec/support/helpers/session_helpers.rb
parent20c84b99005abd1c82101dfeff264ac50d2df211 (diff)
downloadgitlab-ce-16.0.0-rc42.tar.gz
Add latest changes from gitlab-org/gitlab@16-0-stable-eev16.0.0-rc4216-0-stable
Diffstat (limited to 'spec/support/helpers/session_helpers.rb')
-rw-r--r--spec/support/helpers/session_helpers.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/support/helpers/session_helpers.rb b/spec/support/helpers/session_helpers.rb
index 394a401afca..5554695a27d 100644
--- a/spec/support/helpers/session_helpers.rb
+++ b/spec/support/helpers/session_helpers.rb
@@ -39,4 +39,10 @@ module SessionHelpers
def get_ttl(key)
Gitlab::Redis::Sessions.with { |redis| redis.ttl(key) }
end
+
+ def expire_session
+ get_session_keys.each do |key|
+ ::Gitlab::Redis::Sessions.with { |redis| redis.expire(key, -1) }
+ end
+ end
end