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
3c562211
Commit
3c562211
authored
Jul 06, 2017
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `geo_database_configured?` instead of `secondary_role_enabled?`
parent
bbeeaad3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
7 deletions
+6
-7
app/models/geo/base_registry.rb
app/models/geo/base_registry.rb
+1
-1
app/workers/geo_file_download_dispatch_worker.rb
app/workers/geo_file_download_dispatch_worker.rb
+1
-1
app/workers/geo_repository_sync_worker.rb
app/workers/geo_repository_sync_worker.rb
+1
-1
config/initializers/geo.rb
config/initializers/geo.rb
+1
-2
spec/support/db_cleaner.rb
spec/support/db_cleaner.rb
+1
-1
spec/workers/geo_file_download_dispatch_worker_spec.rb
spec/workers/geo_file_download_dispatch_worker_spec.rb
+1
-1
No files found.
app/models/geo/base_registry.rb
View file @
3c562211
class
Geo::BaseRegistry
<
ActiveRecord
::
Base
self
.
abstract_class
=
true
if
Gitlab
::
Geo
.
secondary_role_enabled?
&&
Gitlab
::
Geo
.
geo_database_configured?
if
Gitlab
::
Geo
.
geo_database_configured?
establish_connection
Rails
.
configuration
.
geo_database
end
...
...
app/workers/geo_file_download_dispatch_worker.rb
View file @
3c562211
...
...
@@ -22,7 +22,7 @@ class GeoFileDownloadDispatchWorker
# files, excluding ones in progress.
# 5. Quit when we have scheduled all downloads or exceeded an hour.
def
perform
return
unless
Gitlab
::
Geo
.
secondary_role_enabl
ed?
return
unless
Gitlab
::
Geo
.
geo_database_configur
ed?
return
unless
Gitlab
::
Geo
.
secondary?
@start_time
=
Time
.
now
...
...
app/workers/geo_repository_sync_worker.rb
View file @
3c562211
...
...
@@ -15,7 +15,7 @@ class GeoRepositorySyncWorker
end
def
perform
return
unless
Gitlab
::
Geo
.
secondary_role_enabl
ed?
return
unless
Gitlab
::
Geo
.
geo_database_configur
ed?
return
unless
Gitlab
::
Geo
.
primary_node
.
present?
logger
.
info
"Started Geo repository sync scheduler"
...
...
config/initializers/geo.rb
View file @
3c562211
if
File
.
exist?
(
Rails
.
root
.
join
(
'config/database_geo.yml'
))
&&
Gitlab
::
Geo
.
secondary_role_enabled?
if
File
.
exist?
(
Rails
.
root
.
join
(
'config/database_geo.yml'
))
Rails
.
application
.
configure
do
config
.
geo_database
=
config_for
(
:database_geo
)
end
...
...
spec/support/db_cleaner.rb
View file @
3c562211
...
...
@@ -34,7 +34,7 @@ RSpec.configure do |config|
end
def
setup_database_cleaner
if
Gitlab
::
Geo
.
secondary_role_enabl
ed?
if
Gitlab
::
Geo
.
geo_database_configur
ed?
DatabaseCleaner
[
:active_record
,
{
connection:
Geo
::
BaseRegistry
}]
end
...
...
spec/workers/geo_file_download_dispatch_worker_spec.rb
View file @
3c562211
...
...
@@ -16,7 +16,7 @@ describe GeoFileDownloadDispatchWorker do
it
'does not schedule anything when secondary role is disabled'
do
create
(
:lfs_object
,
:with_file
)
allow
(
Gitlab
::
Geo
).
to
receive
(
:
secondary_role_enabl
ed?
)
{
false
}
allow
(
Gitlab
::
Geo
).
to
receive
(
:
geo_database_configur
ed?
)
{
false
}
expect
(
GeoFileDownloadWorker
).
not_to
receive
(
:perform_async
)
...
...
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