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
0bec1dc9
Commit
0bec1dc9
authored
Mar 29, 2019
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a thin encapsulation around .pluck(:project_id)
parent
9936aa32
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
ee/app/finders/geo/legacy_project_registry_pending_verification_finder.rb
...eo/legacy_project_registry_pending_verification_finder.rb
+3
-3
ee/app/models/geo/project_registry.rb
ee/app/models/geo/project_registry.rb
+4
-0
ee/app/models/project_repository_state.rb
ee/app/models/project_repository_state.rb
+4
-0
No files found.
ee/app/finders/geo/legacy_project_registry_pending_verification_finder.rb
View file @
0bec1dc9
...
...
@@ -70,11 +70,11 @@ module Geo
.
or
(
legacy_repository_state_table
[
:wiki_verification_checksum
].
not_eq
(
nil
)
.
and
(
project_registry_sync_table
[
:want_to_sync_wiki
].
eq
(
true
))))
.
limit
(
batch_size
)
.
pluck
(
:project_id
)
.
pluck
_project_key
legacy_inner_join_registry_ids
(
Geo
::
ProjectRegistry
.
where
(
project_id:
project_ids
),
current_node
.
projects
.
pluck
(
:id
)
,
Geo
::
ProjectRegistry
.
project_id_in
(
project_ids
),
current_node
.
projects
.
pluck
_primary_key
,
Geo
::
ProjectRegistry
,
foreign_key: :project_id
)
...
...
ee/app/models/geo/project_registry.rb
View file @
0bec1dc9
...
...
@@ -31,6 +31,10 @@ class Geo::ProjectRegistry < Geo::BaseRegistry
scope
:wiki_checksum_mismatch
,
->
{
where
(
wiki_checksum_mismatch:
true
)
}
scope
:with_routes
,
->
{
includes
(
project: :route
).
includes
(
project:
{
namespace: :route
})
}
def
self
.
project_id_in
(
ids
)
where
(
project_id:
ids
)
end
def
self
.
failed
repository_sync_failed
=
arel_table
[
:repository_retry_count
].
gt
(
0
)
wiki_sync_failed
=
arel_table
[
:wiki_retry_count
].
gt
(
0
)
...
...
ee/app/models/project_repository_state.rb
View file @
0bec1dc9
...
...
@@ -18,4 +18,8 @@ class ProjectRepositoryState < ApplicationRecord
scope
:verification_failed_wikis
,
->
{
where
.
not
(
last_wiki_verification_failure:
nil
)
}
scope
:verified_repos
,
->
{
where
.
not
(
repository_verification_checksum:
nil
).
where
(
last_repository_verification_failure:
nil
)
}
scope
:verified_wikis
,
->
{
where
.
not
(
wiki_verification_checksum:
nil
).
where
(
last_wiki_verification_failure:
nil
)
}
def
self
.
pluck_project_key
where
(
nil
).
pluck
(
:project_id
)
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