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
1fddf86a
Commit
1fddf86a
authored
Jun 29, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to establish connection to the Geo DB only if config file is present
parent
407036f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
app/models/geo/base_registry.rb
app/models/geo/base_registry.rb
+1
-1
lib/gitlab/geo.rb
lib/gitlab/geo.rb
+4
-0
lib/gitlab/geo/health_check.rb
lib/gitlab/geo/health_check.rb
+1
-5
No files found.
app/models/geo/base_registry.rb
View file @
1fddf86a
class
Geo::BaseRegistry
<
ActiveRecord
::
Base
self
.
abstract_class
=
true
if
Gitlab
::
Geo
.
secondary_role_enabled?
if
Gitlab
::
Geo
.
secondary_role_enabled?
&&
Gitlab
::
Geo
.
geo_database_configured?
establish_connection
Rails
.
configuration
.
geo_database
end
end
lib/gitlab/geo.rb
View file @
1fddf86a
...
...
@@ -50,6 +50,10 @@ module Gitlab
Gitlab
.
config
.
geo_secondary_role
[
'enabled'
]
end
def
self
.
geo_database_configured?
Rails
.
configuration
.
respond_to?
(
:geo_database
)
end
def
self
.
license_allows?
::
License
.
feature_available?
(
:geo
)
end
...
...
lib/gitlab/geo/health_check.rb
View file @
1fddf86a
...
...
@@ -6,7 +6,7 @@ module Gitlab
return
''
unless
Gitlab
::
Geo
.
secondary?
return
'The Geo secondary role is disabled.'
unless
Gitlab
::
Geo
.
secondary_role_enabled?
return
'The Geo database configuration file is missing.'
unless
self
.
geo_database_configured?
return
'The Geo database configuration file is missing.'
unless
Gitlab
::
Geo
.
geo_database_configured?
return
'The Geo node has a database that is not configured for streaming replication with the primary node.'
unless
self
.
database_secondary?
database_version
=
self
.
get_database_version
.
to_i
...
...
@@ -61,10 +61,6 @@ module Gitlab
.
first
.
fetch
(
'pg_is_in_recovery'
)
==
't'
end
def
self
.
geo_database_configured?
Rails
.
configuration
.
respond_to?
(
:geo_database
)
end
end
end
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