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
8bc078cb
Commit
8bc078cb
authored
Mar 16, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the database configuration check to Gitlab::Geo
parent
35eb90d4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
3 deletions
+7
-3
app/models/geo/base_registry.rb
app/models/geo/base_registry.rb
+1
-1
app/workers/geo_backfill_worker.rb
app/workers/geo_backfill_worker.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
-1
No files found.
app/models/geo/base_registry.rb
View file @
8bc078cb
class
Geo::BaseRegistry
<
ActiveRecord
::
Base
self
.
abstract_class
=
true
if
Rails
.
configuration
.
respond_to?
(
:geo_database
)
&&
(
Gitlab
::
Geo
.
secondary?
||
Rails
.
env
.
test?
)
if
Gitlab
::
Geo
.
configuration_available?
&&
(
Gitlab
::
Geo
.
secondary?
||
Rails
.
env
.
test?
)
establish_connection
Rails
.
configuration
.
geo_database
end
end
app/workers/geo_backfill_worker.rb
View file @
8bc078cb
...
...
@@ -6,7 +6,7 @@ class GeoBackfillWorker
BATCH_SIZE
=
100
.
freeze
def
perform
return
unless
Rails
.
configuration
.
respond_to?
(
:geo_database
)
return
unless
Gitlab
::
Geo
.
configuration_available?
return
unless
Gitlab
::
Geo
.
primary_node
.
present?
start_time
=
Time
.
now
...
...
lib/gitlab/geo.rb
View file @
8bc078cb
...
...
@@ -29,6 +29,10 @@ module Gitlab
Gitlab
::
Geo
.
current_node
.
reload
.
enabled?
end
def
self
.
configuration_available?
Rails
.
configuration
.
respond_to?
(
:geo_database
)
end
def
self
.
license_allows?
::
License
.
current
&&
::
License
.
current
.
add_on?
(
'GitLab_Geo'
)
end
...
...
lib/gitlab/geo/health_check.rb
View file @
8bc078cb
...
...
@@ -3,7 +3,7 @@ module Gitlab
class
HealthCheck
def
self
.
perform_checks
return
''
unless
Gitlab
::
Geo
.
secondary?
return
'The Geo database configuration file is missing.'
unless
Rails
.
configuration
.
respond_to?
(
:geo_database
)
return
'The Geo database configuration file is missing.'
unless
Gitlab
::
Geo
.
configuration_available?
database_version
=
self
.
get_database_version
.
to_i
migration_version
=
self
.
get_migration_version
.
to_i
...
...
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