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
75213f33
Commit
75213f33
authored
Aug 01, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove similar code on GeoNodeStatus model
parent
bac2eb4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
app/models/geo_node_status.rb
app/models/geo_node_status.rb
+11
-12
No files found.
app/models/geo_node_status.rb
View file @
75213f33
...
...
@@ -28,12 +28,7 @@ class GeoNodeStatus
end
def
repositories_synced_count
@repositories_synced_count
||=
if
restricted_project_ids
Geo
::
ProjectRegistry
.
synced
.
where
(
project_id:
restricted_project_ids
).
count
else
Geo
::
ProjectRegistry
.
synced
.
count
end
@repositories_synced_count
||=
project_registries
.
synced
.
count
end
def
repositories_synced_count
=
(
value
)
...
...
@@ -45,12 +40,7 @@ class GeoNodeStatus
end
def
repositories_failed_count
@repositories_failed_count
||=
if
restricted_project_ids
Geo
::
ProjectRegistry
.
failed
.
where
(
project_id:
restricted_project_ids
).
count
else
Geo
::
ProjectRegistry
.
failed
.
count
end
@repositories_failed_count
||=
project_registries
.
failed
.
count
end
def
repositories_failed_count
=
(
value
)
...
...
@@ -141,6 +131,15 @@ class GeoNodeStatus
end
end
def
project_registries
@project_registries
||=
if
restricted_project_ids
Geo
::
ProjectRegistry
.
where
(
project_id:
restricted_project_ids
)
else
Geo
::
ProjectRegistry
.
all
end
end
def
restricted_project_ids
return
@restricted_project_ids
if
defined?
(
@restricted_project_ids
)
...
...
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