Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
75ce1755
Commit
75ce1755
authored
Nov 24, 2021
by
nmilojevic1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean Redis::SharedState constants
- Use Redis::Sessions constants instead
parent
862d0b5c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
9 deletions
+5
-9
app/models/active_session.rb
app/models/active_session.rb
+3
-3
config/initializers/session_store.rb
config/initializers/session_store.rb
+1
-1
lib/gitlab/redis/shared_state.rb
lib/gitlab/redis/shared_state.rb
+0
-4
lib/tasks/gitlab/cleanup.rake
lib/tasks/gitlab/cleanup.rake
+1
-1
No files found.
app/models/active_session.rb
View file @
75ce1755
...
...
@@ -125,15 +125,15 @@ class ActiveSession
end
def
self
.
rack_key_name
(
session_id
)
"
#{
redis_store_clas
s
::
SESSION_NAMESPACE
}
:
#{
session_id
}
"
"
#{
Gitlab
::
Redis
::
Session
s
::
SESSION_NAMESPACE
}
:
#{
session_id
}
"
end
def
self
.
key_name
(
user_id
,
session_id
=
'*'
)
"
#{
redis_store_clas
s
::
USER_SESSIONS_NAMESPACE
}
:
#{
user_id
}
:
#{
session_id
}
"
"
#{
Gitlab
::
Redis
::
Session
s
::
USER_SESSIONS_NAMESPACE
}
:
#{
user_id
}
:
#{
session_id
}
"
end
def
self
.
lookup_key_name
(
user_id
)
"
#{
redis_store_clas
s
::
USER_SESSIONS_LOOKUP_NAMESPACE
}
:
#{
user_id
}
"
"
#{
Gitlab
::
Redis
::
Session
s
::
USER_SESSIONS_LOOKUP_NAMESPACE
}
:
#{
user_id
}
"
end
def
self
.
list_sessions
(
user
)
...
...
config/initializers/session_store.rb
View file @
75ce1755
...
...
@@ -25,7 +25,7 @@ store = if Gitlab::Utils.to_boolean(ENV['GITLAB_USE_REDIS_SESSIONS_STORE'], defa
)
else
Gitlab
::
Redis
::
SharedState
.
store
(
namespace:
Gitlab
::
Redis
::
S
haredState
::
SESSION_NAMESPACE
namespace:
Gitlab
::
Redis
::
S
essions
::
SESSION_NAMESPACE
)
end
...
...
lib/gitlab/redis/shared_state.rb
View file @
75ce1755
...
...
@@ -3,10 +3,6 @@
module
Gitlab
module
Redis
class
SharedState
<
::
Gitlab
::
Redis
::
Wrapper
SESSION_NAMESPACE
=
'session:gitlab'
USER_SESSIONS_NAMESPACE
=
'session:user:gitlab'
USER_SESSIONS_LOOKUP_NAMESPACE
=
'session:lookup:user:gitlab'
IP_SESSIONS_LOOKUP_NAMESPACE
=
'session:lookup:ip:gitlab2'
end
end
end
lib/tasks/gitlab/cleanup.rake
View file @
75ce1755
...
...
@@ -102,7 +102,7 @@ namespace :gitlab do
task
active_sessions_lookup_keys: :gitlab_environment
do
use_redis_session_store
=
Gitlab
::
Utils
.
to_boolean
(
ENV
[
'GITLAB_USE_REDIS_SESSIONS_STORE'
],
default:
true
)
redis_store_class
=
use_redis_session_store
?
Gitlab
::
Redis
::
Sessions
:
Gitlab
::
Redis
::
SharedState
session_key_pattern
=
"
#{
redis_store_clas
s
::
USER_SESSIONS_LOOKUP_NAMESPACE
}
:*"
session_key_pattern
=
"
#{
Gitlab
::
Redis
::
Session
s
::
USER_SESSIONS_LOOKUP_NAMESPACE
}
:*"
last_save_check
=
Time
.
at
(
0
)
wait_time
=
10
.
seconds
cursor
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment