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
65520763
Commit
65520763
authored
Nov 28, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract a base Geo::RegistryFinder
parent
4a131756
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
30 deletions
+25
-30
app/finders/geo/file_registry_finder.rb
app/finders/geo/file_registry_finder.rb
+3
-13
app/finders/geo/project_registry_finder.rb
app/finders/geo/project_registry_finder.rb
+1
-17
app/finders/geo/registry_finder.rb
app/finders/geo/registry_finder.rb
+21
-0
No files found.
app/finders/geo/file_registry_finder.rb
View file @
65520763
module
Geo
module
Geo
class
FileRegistryFinder
class
FileRegistryFinder
<
RegistryFinder
attr_reader
:current_node
def
initialize
(
current_node:
nil
)
@current_node
=
current_node
end
def
find_failed_objects
(
batch_size
:)
def
find_failed_objects
(
batch_size
:)
Geo
::
FileRegistry
Geo
::
FileRegistry
.
failed
.
failed
...
@@ -28,7 +22,7 @@ module Geo
...
@@ -28,7 +22,7 @@ module Geo
# Selective project replication adds a wrinkle to FDW queries, so
# Selective project replication adds a wrinkle to FDW queries, so
# we fallback to the legacy version for now.
# we fallback to the legacy version for now.
relation
=
relation
=
if
Gitlab
::
Geo
.
fdw?
&&
!
selective_sync
if
fdw?
fdw_find_nonreplicated_lfs_objects
fdw_find_nonreplicated_lfs_objects
else
else
legacy_find_nonreplicated_lfs_objects
(
except_registry_ids:
except_registry_ids
)
legacy_find_nonreplicated_lfs_objects
(
except_registry_ids:
except_registry_ids
)
...
@@ -54,7 +48,7 @@ module Geo
...
@@ -54,7 +48,7 @@ module Geo
# Selective project replication adds a wrinkle to FDW queries, so
# Selective project replication adds a wrinkle to FDW queries, so
# we fallback to the legacy version for now.
# we fallback to the legacy version for now.
relation
=
relation
=
if
Gitlab
::
Geo
.
fdw?
&&
!
selective_sync
if
fdw?
fdw_find_nonreplicated_uploads
fdw_find_nonreplicated_uploads
else
else
legacy_find_nonreplicated_uploads
(
except_registry_ids:
except_registry_ids
)
legacy_find_nonreplicated_uploads
(
except_registry_ids:
except_registry_ids
)
...
@@ -68,10 +62,6 @@ module Geo
...
@@ -68,10 +62,6 @@ module Geo
protected
protected
def
selective_sync
current_node
.
restricted_project_ids
end
#
#
# FDW accessors
# FDW accessors
#
#
...
...
app/finders/geo/project_registry_finder.rb
View file @
65520763
module
Geo
module
Geo
class
ProjectRegistryFinder
class
ProjectRegistryFinder
<
RegistryFinder
attr_reader
:current_node
def
initialize
(
current_node:
nil
)
@current_node
=
current_node
end
def
find_unsynced_projects
(
batch_size
:)
def
find_unsynced_projects
(
batch_size
:)
relation
=
relation
=
if
fdw?
if
fdw?
...
@@ -30,20 +24,10 @@ module Geo
...
@@ -30,20 +24,10 @@ module Geo
protected
protected
def
fdw?
# Selective project replication adds a wrinkle to FDW
# queries, so we fallback to the legacy version for now.
Gitlab
::
Geo
.
fdw?
&&
!
selective_sync
end
def
fdw_table
def
fdw_table
Geo
::
Fdw
::
Project
.
table_name
Geo
::
Fdw
::
Project
.
table_name
end
end
def
selective_sync
current_node
.
restricted_project_ids
end
#
#
# FDW accessors
# FDW accessors
#
#
...
...
app/finders/geo/registry_finder.rb
0 → 100644
View file @
65520763
module
Geo
class
RegistryFinder
attr_reader
:current_node
def
initialize
(
current_node:
nil
)
@current_node
=
current_node
end
protected
def
fdw?
# Selective project replication adds a wrinkle to FDW
# queries, so we fallback to the legacy version for now.
Gitlab
::
Geo
.
fdw?
&&
!
selective_sync
end
def
selective_sync
current_node
.
restricted_project_ids
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