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
fd6dfbec
Commit
fd6dfbec
authored
Nov 29, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor project registry
parent
83d9d9b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
app/models/geo/project_registry.rb
app/models/geo/project_registry.rb
+2
-0
app/models/geo_node.rb
app/models/geo_node.rb
+11
-0
No files found.
app/models/geo/project_registry.rb
View file @
fd6dfbec
...
...
@@ -4,6 +4,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
:failed_repos
,
->
{
where
(
arel_table
[
:repository_retry_count
].
gt
(
0
))
}
scope
:failed_wikis
,
->
{
where
(
arel_table
[
:wiki_retry_count
].
gt
(
0
))
}
def
self
.
failed
repository_sync_failed
=
arel_table
[
:repository_retry_count
].
gt
(
0
)
...
...
app/models/geo_node.rb
View file @
fd6dfbec
...
...
@@ -164,6 +164,17 @@ class GeoNode < ActiveRecord::Base
end
end
def
project_registries_by
(
type:
nil
)
case
type
when
'repository'
project_registries
.
failed_repos
when
'wiki'
project_registries
.
failed_repos
else
project_registries
end
end
def
uploads
if
restricted_project_ids
uploads_table
=
Upload
.
arel_table
...
...
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