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
340b2f79
Commit
340b2f79
authored
May 25, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use geo_secondary_role to set tracking database connection properly
parent
2b1e6a44
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
2 deletions
+14
-2
app/models/geo/base_registry.rb
app/models/geo/base_registry.rb
+1
-1
config/gitlab.yml.example
config/gitlab.yml.example
+6
-0
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+2
-0
config/initializers/geo.rb
config/initializers/geo.rb
+1
-1
lib/gitlab/geo.rb
lib/gitlab/geo.rb
+4
-0
No files found.
app/models/geo/base_registry.rb
View file @
340b2f79
class
Geo::BaseRegistry
<
ActiveRecord
::
Base
self
.
abstract_class
=
true
if
Gitlab
::
Geo
.
configured?
&&
(
Gitlab
::
Geo
.
secondary?
||
Rails
.
env
.
test?
)
if
Gitlab
::
Geo
.
secondary_role_enabled?
establish_connection
Rails
.
configuration
.
geo_database
end
end
config/gitlab.yml.example
View file @
340b2f79
...
...
@@ -622,6 +622,10 @@ production: &base
# host: localhost
# port: 3808
## GitLab Geo settings (EE-only)
geo_secondary_role:
enable: false
#
# 5. Extra customization
# ==========================
...
...
@@ -705,6 +709,8 @@ test:
user_filter: ''
group_base: 'ou=groups,dc=example,dc=com'
admin_group: ''
geo_secondary_role:
enable: true
staging:
<<: *base
config/initializers/1_settings.rb
View file @
340b2f79
...
...
@@ -342,6 +342,8 @@ Settings.pages['external_https'] ||= false unless Settings.pages['external_http
# Geo
#
Settings
.
gitlab
[
'geo_status_timeout'
]
||=
10
Settings
[
'geo_secondary_role'
]
||=
Settingslogic
.
new
({})
Settings
.
geo_secondary_role
[
'enable'
]
=
false
if
Settings
.
geo_secondary_role
[
'enable'
].
nil?
#
# Git LFS
...
...
config/initializers/geo.rb
View file @
340b2f79
if
File
.
exist?
(
Rails
.
root
.
join
(
'config/database_geo.yml'
))
if
Gitlab
::
Geo
.
secondary_role_enabled?
Rails
.
application
.
configure
do
config
.
geo_database
=
config_for
(
:database_geo
)
end
...
...
lib/gitlab/geo.rb
View file @
340b2f79
...
...
@@ -46,6 +46,10 @@ module Gitlab
Rails
.
configuration
.
respond_to?
(
:geo_database
)
end
def
self
.
secondary_role_enabled?
Gitlab
.
config
.
geo_secondary_role
[
'enable'
]
end
def
self
.
license_allows?
::
License
.
current
&
.
feature_available?
(
:geo
)
end
...
...
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