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
0dc6e640
Commit
0dc6e640
authored
Mar 03, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Load Geo DB only when Geo database config file exist
parent
80f6662a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
14 deletions
+4
-14
config/application.rb
config/application.rb
+0
-3
config/initializers/geo.rb
config/initializers/geo.rb
+1
-1
config/initializers/health_check.rb
config/initializers/health_check.rb
+2
-4
lib/gitlab/geo.rb
lib/gitlab/geo.rb
+1
-6
No files found.
config/application.rb
View file @
0dc6e640
...
...
@@ -158,8 +158,5 @@ module Gitlab
config
.
generators
do
|
g
|
g
.
factory_girl
false
end
# This is needed for GitLab Geo
config
.
assets
.
initialize_on_precompile
=
false
end
end
config/initializers/geo.rb
View file @
0dc6e640
if
Gitlab
::
Geo
.
secondary?
if
File
.
exist?
(
Rails
.
root
.
join
(
'config/database_geo.yml'
))
Rails
.
application
.
configure
do
config
.
geo_database
=
config_for
(
:database_geo
)
end
...
...
config/initializers/health_check.rb
View file @
0dc6e640
...
...
@@ -2,9 +2,7 @@ HealthCheck.setup do |config|
config
.
standard_checks
=
%w(database migrations cache)
config
.
full_checks
=
%w(database migrations cache)
if
Gitlab
::
Geo
.
secondary?
config
.
add_custom_check
(
'geo'
)
do
Gitlab
::
Geo
::
HealthCheck
.
perform_checks
end
end
end
lib/gitlab/geo.rb
View file @
0dc6e640
...
...
@@ -19,7 +19,7 @@ module Gitlab
end
def
self
.
enabled?
self
.
cache_value
(
:geo_node_enabled
)
{
self
.
connected_to_primary_db?
&&
GeoNode
.
exists?
}
self
.
cache_value
(
:geo_node_enabled
)
{
GeoNode
.
exists?
}
end
def
self
.
license_allows?
...
...
@@ -80,10 +80,5 @@ module Gitlab
# urlsafe_base64 may return a string of size * 4/3
SecureRandom
.
urlsafe_base64
(
size
)[
0
,
size
]
end
def
self
.
connected_to_primary_db?
ActiveRecord
::
Base
.
connection
.
active?
&&
ActiveRecord
::
Base
.
connection
.
table_exists?
(
GeoNode
.
table_name
)
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