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
cd1b8f68
Commit
cd1b8f68
authored
Aug 24, 2020
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor Geo::DesignRegistryFinder class
parent
b22d6097
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
ee/app/finders/geo/design_registry_finder.rb
ee/app/finders/geo/design_registry_finder.rb
+10
-13
No files found.
ee/app/finders/geo/design_registry_finder.rb
View file @
cd1b8f68
...
...
@@ -3,24 +3,21 @@
module
Geo
class
DesignRegistryFinder
<
RegistryFinder
def
registry_count
design
s
.
count
registry_clas
s
.
count
end
alias_method
:count_registry
,
:registry_count
def
count_synced
registr
ie
s
.
synced
.
count
registr
y_clas
s
.
synced
.
count
end
def
count_failed
registries
.
failed
.
count
end
def
count_registry
registries
.
count
registry_class
.
failed
.
count
end
def
find_registry_differences
(
range
)
source_ids
=
design
s
.
id_in
(
range
).
pluck_primary_key
tracked_ids
=
registr
ie
s
.
pluck_model_ids_in_range
(
range
)
source_ids
=
replicable
s
.
id_in
(
range
).
pluck_primary_key
tracked_ids
=
registr
y_clas
s
.
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:
[])
registr
ie
s
registr
y_clas
s
.
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:
[])
registr
ie
s
registr
y_clas
s
.
updated_recently
.
model_id_not_in
(
except_ids
)
.
order
(
Gitlab
::
Database
.
nulls_first_order
(
:last_synced_at
))
...
...
@@ -65,11 +62,11 @@ module Geo
private
def
design
s
def
replicable
s
current_node
.
designs
end
def
registr
ie
s
def
registr
y_clas
s
Geo
::
DesignRegistry
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