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
72f1f210
Commit
72f1f210
authored
Mar 27, 2019
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor finder to find registries pending verification
parent
36263d0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
61 deletions
+4
-61
ee/app/finders/geo/project_registry_pending_verification_finder.rb
...nders/geo/project_registry_pending_verification_finder.rb
+4
-61
No files found.
ee/app/finders/geo/project_registry_pending_verification_finder.rb
View file @
72f1f210
...
...
@@ -18,73 +18,16 @@ module Geo
end
def
execute
repo_condition
=
local_repo_condition
.
and
(
fdw_repository_state_table
[
:repository_verification_checksum
].
not_eq
(
nil
))
wiki_condition
=
local_wiki_condition
.
and
(
fdw_repository_state_table
[
:wiki_verification_checksum
].
not_eq
(
nil
))
current_node
.
project_registries
.
joins
(
fdw_inner_join_projects
)
.
joins
(
fdw_inner_join_repository_state
)
.
where
(
repo_condition
.
or
(
wiki_condition
)
)
.
where
(
fdw_project_table
[
:repository_storage
].
eq
(
shard_name
))
.
joins
(
Geo
::
Fdw
::
GeoNode
.
fdw_inner_join_projects
)
.
joins
(
Geo
::
Fdw
::
GeoNode
.
fdw_inner_join_repository_state
)
.
where
(
Geo
::
Fdw
::
GeoNode
.
fdw_registries_pending_verification
)
.
where
(
Geo
::
Fdw
::
Project
.
within_shard
(
shard_name
))
.
limit
(
batch_size
)
end
private
attr_reader
:current_node
,
:shard_name
,
:batch_size
def
local_registry_table
Geo
::
ProjectRegistry
.
arel_table
end
def
fdw_project_table
Geo
::
Fdw
::
Project
.
arel_table
end
def
fdw_repository_state_table
Geo
::
Fdw
::
ProjectRepositoryState
.
arel_table
end
def
fdw_inner_join_projects
local_registry_table
.
join
(
fdw_project_table
,
Arel
::
Nodes
::
InnerJoin
)
.
on
(
local_registry_table
[
:project_id
].
eq
(
fdw_project_table
[
:id
]))
.
join_sources
end
def
fdw_inner_join_repository_state
local_registry_table
.
join
(
fdw_repository_state_table
,
Arel
::
Nodes
::
InnerJoin
)
.
on
(
local_registry_table
[
:project_id
].
eq
(
fdw_repository_state_table
[
:project_id
]))
.
join_sources
end
def
local_repo_condition
local_registry_table
[
:repository_verification_checksum_sha
].
eq
(
nil
)
.
and
(
local_registry_table
[
:last_repository_verification_failure
].
eq
(
nil
))
.
and
(
local_registry_table
[
:resync_repository
].
eq
(
false
))
.
and
(
repository_missing_on_primary_is_not_true
)
end
def
repository_missing_on_primary_is_not_true
Arel
::
Nodes
::
SqlLiteral
.
new
(
"project_registry.repository_missing_on_primary IS NOT TRUE"
)
end
def
local_wiki_condition
local_registry_table
[
:wiki_verification_checksum_sha
].
eq
(
nil
)
.
and
(
local_registry_table
[
:last_wiki_verification_failure
].
eq
(
nil
))
.
and
(
local_registry_table
[
:resync_wiki
].
eq
(
false
))
.
and
(
wiki_missing_on_primary_is_not_true
)
end
def
wiki_missing_on_primary_is_not_true
Arel
::
Nodes
::
SqlLiteral
.
new
(
"project_registry.wiki_missing_on_primary IS NOT TRUE"
)
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