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
8da7e8e6
Commit
8da7e8e6
authored
Aug 27, 2020
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove current_node from base registry finder
Refactor code to make the finder class closer to a Geo replicator.
parent
49c9638e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
25 deletions
+9
-25
ee/app/finders/geo/registry_finder.rb
ee/app/finders/geo/registry_finder.rb
+0
-16
ee/app/models/geo_node_status.rb
ee/app/models/geo_node_status.rb
+5
-5
ee/app/workers/geo/container_repository_sync_dispatch_worker.rb
.../workers/geo/container_repository_sync_dispatch_worker.rb
+1
-1
ee/app/workers/geo/file_download_dispatch_worker/attachment_job_finder.rb
...eo/file_download_dispatch_worker/attachment_job_finder.rb
+1
-1
ee/app/workers/geo/file_download_dispatch_worker/job_artifact_job_finder.rb
.../file_download_dispatch_worker/job_artifact_job_finder.rb
+1
-1
ee/app/workers/geo/file_download_dispatch_worker/lfs_object_job_finder.rb
...eo/file_download_dispatch_worker/lfs_object_job_finder.rb
+1
-1
No files found.
ee/app/finders/geo/registry_finder.rb
View file @
8da7e8e6
...
...
@@ -2,14 +2,6 @@
module
Geo
class
RegistryFinder
include
::
Gitlab
::
Utils
::
StrongMemoize
attr_reader
:current_node_id
def
initialize
(
current_node_id:
nil
)
@current_node_id
=
current_node_id
end
# @!method find_unsynced_registries
# Return an ActiveRecord::Relation of the registry records for the
# tracked ype that have never been synced.
...
...
@@ -77,13 +69,5 @@ module Geo
def
failed_count
registry_class
.
failed
.
count
end
private
def
current_node
strong_memoize
(
:current_node
)
do
GeoNode
.
find
(
current_node_id
)
if
current_node_id
end
end
end
end
ee/app/models/geo_node_status.rb
View file @
8da7e8e6
...
...
@@ -581,23 +581,23 @@ class GeoNodeStatus < ApplicationRecord
end
def
attachments_finder
@attachments_finder
||=
Geo
::
AttachmentRegistryFinder
.
new
(
current_node_id:
geo_node
.
id
)
@attachments_finder
||=
Geo
::
AttachmentRegistryFinder
.
new
end
def
lfs_objects_finder
@lfs_objects_finder
||=
Geo
::
LfsObjectRegistryFinder
.
new
(
current_node_id:
geo_node
.
id
)
@lfs_objects_finder
||=
Geo
::
LfsObjectRegistryFinder
.
new
end
def
job_artifacts_finder
@job_artifacts_finder
||=
Geo
::
JobArtifactRegistryFinder
.
new
(
current_node_id:
geo_node
.
id
)
@job_artifacts_finder
||=
Geo
::
JobArtifactRegistryFinder
.
new
end
def
container_registry_finder
@container_registry_finder
||=
Geo
::
ContainerRepositoryRegistryFinder
.
new
(
current_node_id:
geo_node
.
id
)
@container_registry_finder
||=
Geo
::
ContainerRepositoryRegistryFinder
.
new
end
def
design_registry_finder
@design_registry_finder
||=
Geo
::
DesignRegistryFinder
.
new
(
current_node_id:
geo_node
.
id
)
@design_registry_finder
||=
Geo
::
DesignRegistryFinder
.
new
end
def
repository_verification_finder
...
...
ee/app/workers/geo/container_repository_sync_dispatch_worker.rb
View file @
8da7e8e6
...
...
@@ -59,7 +59,7 @@ module Geo
end
def
registry_finder
@registry_finder
||=
Geo
::
ContainerRepositoryRegistryFinder
.
new
(
current_node_id:
current_node
.
id
)
@registry_finder
||=
Geo
::
ContainerRepositoryRegistryFinder
.
new
end
end
end
ee/app/workers/geo/file_download_dispatch_worker/attachment_job_finder.rb
View file @
8da7e8e6
...
...
@@ -6,7 +6,7 @@ module Geo
EXCEPT_RESOURCE_IDS_KEY
=
:except_ids
def
registry_finder
@registry_finder
||=
Geo
::
AttachmentRegistryFinder
.
new
(
current_node_id:
Gitlab
::
Geo
.
current_node
.
id
)
@registry_finder
||=
Geo
::
AttachmentRegistryFinder
.
new
end
private
...
...
ee/app/workers/geo/file_download_dispatch_worker/job_artifact_job_finder.rb
View file @
8da7e8e6
...
...
@@ -8,7 +8,7 @@ module Geo
FILE_SERVICE_OBJECT_TYPE
=
:job_artifact
def
registry_finder
@registry_finder
||=
Geo
::
JobArtifactRegistryFinder
.
new
(
current_node_id:
Gitlab
::
Geo
.
current_node
.
id
)
@registry_finder
||=
Geo
::
JobArtifactRegistryFinder
.
new
end
end
end
...
...
ee/app/workers/geo/file_download_dispatch_worker/lfs_object_job_finder.rb
View file @
8da7e8e6
...
...
@@ -8,7 +8,7 @@ module Geo
FILE_SERVICE_OBJECT_TYPE
=
:lfs
def
registry_finder
@registry_finder
||=
Geo
::
LfsObjectRegistryFinder
.
new
(
current_node_id:
Gitlab
::
Geo
.
current_node
.
id
)
@registry_finder
||=
Geo
::
LfsObjectRegistryFinder
.
new
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