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
4ca16e67
Commit
4ca16e67
authored
Mar 29, 2018
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify synced scopes
parent
d010f667
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
ee/app/models/geo/project_registry.rb
ee/app/models/geo/project_registry.rb
+2
-10
ee/changelogs/unreleased/mk-geo-fix-inconsistent-project-registry-queries.yml
...ased/mk-geo-fix-inconsistent-project-registry-queries.yml
+5
-0
No files found.
ee/app/models/geo/project_registry.rb
View file @
4ca16e67
...
...
@@ -12,6 +12,8 @@ class Geo::ProjectRegistry < Geo::BaseRegistry
validates
:project
,
presence:
true
,
uniqueness:
true
scope
:dirty
,
->
{
where
(
arel_table
[
:resync_repository
].
eq
(
true
).
or
(
arel_table
[
:resync_wiki
].
eq
(
true
)))
}
scope
:synced_repos
,
->
{
where
(
resync_repository:
false
)
}
scope
:synced_wikis
,
->
{
where
(
resync_wiki:
false
)
}
scope
:failed_repos
,
->
{
where
(
arel_table
[
:repository_retry_count
].
gt
(
0
))
}
scope
:failed_wikis
,
->
{
where
(
arel_table
[
:wiki_retry_count
].
gt
(
0
))
}
scope
:verified_repos
,
->
{
where
.
not
(
repository_verification_checksum:
nil
)
}
...
...
@@ -42,16 +44,6 @@ class Geo::ProjectRegistry < Geo::BaseRegistry
)
end
def
self
.
synced_repos
where
.
not
(
last_repository_synced_at:
nil
,
last_repository_successful_sync_at:
nil
)
.
where
(
resync_repository:
false
)
end
def
self
.
synced_wikis
where
.
not
(
last_wiki_synced_at:
nil
,
last_wiki_successful_sync_at:
nil
)
.
where
(
resync_wiki:
false
)
end
def
repository_sync_due?
(
scheduled_time
)
never_synced_repository?
||
repository_sync_needed?
(
scheduled_time
)
end
...
...
ee/changelogs/unreleased/mk-geo-fix-inconsistent-project-registry-queries.yml
0 → 100644
View file @
4ca16e67
---
title
:
'
Geo:
Make
synced/failed
scopes
more
consistent'
merge_request
:
5171
author
:
type
:
fixed
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