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
class
FileRegistryFinder
attr_reader
:current_node
def
initialize
(
current_node:
nil
)
@current_node
=
current_node
end
class
FileRegistryFinder
<
RegistryFinder
def
find_failed_objects
(
batch_size
:)
Geo
::
FileRegistry
.
failed
...
...
@@ -28,7 +22,7 @@ module Geo
# Selective project replication adds a wrinkle to FDW queries, so
# we fallback to the legacy version for now.
relation
=
if
Gitlab
::
Geo
.
fdw?
&&
!
selective_sync
if
fdw?
fdw_find_nonreplicated_lfs_objects
else
legacy_find_nonreplicated_lfs_objects
(
except_registry_ids:
except_registry_ids
)
...
...
@@ -54,7 +48,7 @@ module Geo
# Selective project replication adds a wrinkle to FDW queries, so
# we fallback to the legacy version for now.
relation
=
if
Gitlab
::
Geo
.
fdw?
&&
!
selective_sync
if
fdw?
fdw_find_nonreplicated_uploads
else
legacy_find_nonreplicated_uploads
(
except_registry_ids:
except_registry_ids
)
...
...
@@ -68,10 +62,6 @@ module Geo
protected
def
selective_sync
current_node
.
restricted_project_ids
end
#
# FDW accessors
#
...
...
app/finders/geo/project_registry_finder.rb
View file @
65520763
module
Geo
class
ProjectRegistryFinder
attr_reader
:current_node
def
initialize
(
current_node:
nil
)
@current_node
=
current_node
end
class
ProjectRegistryFinder
<
RegistryFinder
def
find_unsynced_projects
(
batch_size
:)
relation
=
if
fdw?
...
...
@@ -30,20 +24,10 @@ module Geo
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
Geo
::
Fdw
::
Project
.
table_name
end
def
selective_sync
current_node
.
restricted_project_ids
end
#
# 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