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
54b26296
Commit
54b26296
authored
Dec 06, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove GeoNode#uploads method
parent
3c86b1e1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
20 deletions
+8
-20
app/models/geo_node.rb
app/models/geo_node.rb
+0
-16
app/models/geo_node_status.rb
app/models/geo_node_status.rb
+1
-1
ee/app/finders/geo/attachment_registry_finder.rb
ee/app/finders/geo/attachment_registry_finder.rb
+2
-2
ee/app/finders/geo/file_registry_finder.rb
ee/app/finders/geo/file_registry_finder.rb
+5
-1
No files found.
app/models/geo_node.rb
View file @
54b26296
...
@@ -149,22 +149,6 @@ class GeoNode < ActiveRecord::Base
...
@@ -149,22 +149,6 @@ class GeoNode < ActiveRecord::Base
namespaces
.
exists?
namespaces
.
exists?
end
end
def
uploads
if
selective_sync?
namespace_ids
=
Gitlab
::
GroupHierarchy
.
new
(
Gitlab
::
Geo
.
current_node
.
namespaces
).
base_and_descendants
.
select
(
:id
)
project_ids
=
Gitlab
::
Geo
.
current_node
.
projects
.
select
(
:id
)
uploads_table
=
Upload
.
arel_table
group_uploads
=
uploads_table
[
:model_type
].
eq
(
'Namespace'
).
and
(
uploads_table
[
:model_id
].
in
(
Arel
::
Nodes
::
SqlLiteral
.
new
(
namespace_ids
.
to_sql
)))
project_uploads
=
uploads_table
[
:model_type
].
eq
(
'Project'
).
and
(
uploads_table
[
:model_id
].
in
(
Arel
::
Nodes
::
SqlLiteral
.
new
(
project_ids
.
to_sql
)))
other_uploads
=
uploads_table
[
:model_type
].
not_in
(
%w[Namespace Project]
)
Upload
.
where
(
group_uploads
.
or
(
project_uploads
).
or
(
other_uploads
))
else
Upload
.
all
end
end
def
find_or_build_status
def
find_or_build_status
status
||
build_status
status
||
build_status
end
end
...
...
app/models/geo_node_status.rb
View file @
54b26296
...
@@ -65,7 +65,7 @@ class GeoNodeStatus < ActiveRecord::Base
...
@@ -65,7 +65,7 @@ class GeoNodeStatus < ActiveRecord::Base
self
.
last_event_date
=
latest_event
&
.
created_at
self
.
last_event_date
=
latest_event
&
.
created_at
self
.
repositories_count
=
geo_node
.
projects
.
count
self
.
repositories_count
=
geo_node
.
projects
.
count
self
.
lfs_objects_count
=
geo_node
.
lfs_objects
.
count
self
.
lfs_objects_count
=
geo_node
.
lfs_objects
.
count
self
.
attachments_count
=
geo_node
.
uploads
.
count
self
.
attachments_count
=
attachments_finder
.
uploads
.
count
self
.
last_successful_status_check_at
=
Time
.
now
self
.
last_successful_status_check_at
=
Time
.
now
if
Gitlab
::
Geo
.
secondary?
if
Gitlab
::
Geo
.
secondary?
...
...
ee/app/finders/geo/attachment_registry_finder.rb
View file @
54b26296
...
@@ -22,8 +22,6 @@ module Geo
...
@@ -22,8 +22,6 @@ module Geo
relation
relation
end
end
private
def
uploads
def
uploads
if
selective_sync?
if
selective_sync?
Upload
.
where
(
group_uploads
.
or
(
project_uploads
).
or
(
other_uploads
))
Upload
.
where
(
group_uploads
.
or
(
project_uploads
).
or
(
other_uploads
))
...
@@ -32,6 +30,8 @@ module Geo
...
@@ -32,6 +30,8 @@ module Geo
end
end
end
end
private
def
group_uploads
def
group_uploads
namespace_ids
=
Gitlab
::
GroupHierarchy
.
new
(
current_node
.
namespaces
).
base_and_descendants
.
select
(
:id
)
namespace_ids
=
Gitlab
::
GroupHierarchy
.
new
(
current_node
.
namespaces
).
base_and_descendants
.
select
(
:id
)
arel_namespace_ids
=
Arel
::
Nodes
::
SqlLiteral
.
new
(
namespace_ids
.
to_sql
)
arel_namespace_ids
=
Arel
::
Nodes
::
SqlLiteral
.
new
(
namespace_ids
.
to_sql
)
...
...
ee/app/finders/geo/file_registry_finder.rb
View file @
54b26296
...
@@ -105,7 +105,7 @@ module Geo
...
@@ -105,7 +105,7 @@ module Geo
registry_ids
=
legacy_pluck_registry_ids
(
file_types:
Geo
::
FileService
::
DEFAULT_OBJECT_TYPES
,
except_registry_ids:
except_registry_ids
)
registry_ids
=
legacy_pluck_registry_ids
(
file_types:
Geo
::
FileService
::
DEFAULT_OBJECT_TYPES
,
except_registry_ids:
except_registry_ids
)
legacy_filter_registry_ids
(
legacy_filter_registry_ids
(
current_node
.
uploads
,
attachments_finder
.
uploads
,
registry_ids
,
registry_ids
,
Upload
.
table_name
Upload
.
table_name
)
)
...
@@ -132,5 +132,9 @@ module Geo
...
@@ -132,5 +132,9 @@ module Geo
ids
=
Geo
::
FileRegistry
.
where
(
file_type:
file_types
).
pluck
(
:file_id
)
ids
=
Geo
::
FileRegistry
.
where
(
file_type:
file_types
).
pluck
(
:file_id
)
(
ids
+
except_registry_ids
).
uniq
(
ids
+
except_registry_ids
).
uniq
end
end
def
attachments_finder
@attachments_finder
||=
AttachmentRegistryFinder
.
new
(
current_node:
current_node
)
end
end
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