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
a557ef63
Commit
a557ef63
authored
Aug 24, 2020
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor Geo::ContainerRepositoryRegistryFinder class
parent
cd1b8f68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
ee/app/finders/geo/container_repository_registry_finder.rb
ee/app/finders/geo/container_repository_registry_finder.rb
+13
-12
No files found.
ee/app/finders/geo/container_repository_registry_finder.rb
View file @
a557ef63
...
...
@@ -3,24 +3,21 @@
module
Geo
class
ContainerRepositoryRegistryFinder
<
RegistryFinder
def
registry_count
container_repositorie
s
.
count
registry_clas
s
.
count
end
alias_method
:count_registry
,
:registry_count
def
count_synced
Geo
::
ContainerRepositoryRegistry
.
synced
.
count
registry_class
.
synced
.
count
end
def
count_failed
Geo
::
ContainerRepositoryRegistry
.
failed
.
count
end
def
count_registry
Geo
::
ContainerRepositoryRegistry
.
count
registry_class
.
failed
.
count
end
def
find_registry_differences
(
range
)
source_ids
=
container_repositori
es
.
id_in
(
range
).
pluck_primary_key
tracked_ids
=
Geo
::
ContainerRepositoryRegistry
.
pluck_model_ids_in_range
(
range
)
source_ids
=
replicabl
es
.
id_in
(
range
).
pluck_primary_key
tracked_ids
=
registry_class
.
pluck_model_ids_in_range
(
range
)
untracked_ids
=
source_ids
-
tracked_ids
unused_tracked_ids
=
tracked_ids
-
source_ids
...
...
@@ -46,7 +43,7 @@ module Geo
# @param [Array<Integer>] except_ids ids that will be ignored from the query
# rubocop:disable CodeReuse/ActiveRecord
def
find_never_synced_registries
(
batch_size
:,
except_ids:
[])
Geo
::
ContainerRepositoryRegistry
registry_class
.
never_synced
.
model_id_not_in
(
except_ids
)
.
limit
(
batch_size
)
...
...
@@ -55,7 +52,7 @@ module Geo
# rubocop:disable CodeReuse/ActiveRecord
def
find_retryable_dirty_registries
(
batch_size
:,
except_ids:
[])
Geo
::
ContainerRepositoryRegistry
registry_class
.
failed
.
retry_due
.
model_id_not_in
(
except_ids
)
...
...
@@ -66,8 +63,12 @@ module Geo
private
def
container_repositori
es
def
replicabl
es
current_node
.
container_repositories
end
def
registry_class
Geo
::
ContainerRepositoryRegistry
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