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
ecdb5a38
Commit
ecdb5a38
authored
Apr 05, 2021
by
Quang-Minh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move magic symbol into a constant
parent
ef5c42dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
ee/lib/ee/peek/views/active_record.rb
ee/lib/ee/peek/views/active_record.rb
+2
-1
ee/lib/gitlab/database/load_balancing.rb
ee/lib/gitlab/database/load_balancing.rb
+2
-1
No files found.
ee/lib/ee/peek/views/active_record.rb
View file @
ecdb5a38
...
...
@@ -11,7 +11,8 @@ module EE
detail
=
super
if
::
Gitlab
::
Database
::
LoadBalancing
.
enable?
role
=
::
Gitlab
::
Database
::
LoadBalancing
.
db_role_for_connection
(
data
[
:connection
])
||
:unknown
role
=
::
Gitlab
::
Database
::
LoadBalancing
.
db_role_for_connection
(
data
[
:connection
])
||
::
Gitlab
::
Database
::
LoadBalancing
::
ROLE_UNKNOWN
detail
[
:db_role
]
=
role
.
to_s
.
capitalize
end
...
...
ee/lib/gitlab/database/load_balancing.rb
View file @
ecdb5a38
...
...
@@ -143,7 +143,8 @@ module Gitlab
DB_ROLES
=
[
ROLE_PRIMARY
=
:primary
,
ROLE_REPLICA
=
:replica
ROLE_REPLICA
=
:replica
,
ROLE_UNKNOWN
=
:unknown
].
freeze
# Returns the role (primary/replica) of the database the connection is
...
...
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