Commit 8cf121e8 authored by Mike Kozono's avatar Mike Kozono

Push scopes out of find_registry_differences

And defer refactoring GeoNode#lfs_objects for a follow up.
parent 85632be2
...@@ -54,8 +54,7 @@ module Geo ...@@ -54,8 +54,7 @@ module Geo
# #
# @return [Array] the first element is an Array of untracked IDs, and the second element is an Array of tracked IDs that are unused # @return [Array] the first element is an Array of untracked IDs, and the second element is an Array of tracked IDs that are unused
def find_registry_differences(range) def find_registry_differences(range)
source = local_storage_only? ? replicables.with_files_stored_locally : replicables source_ids = replicables.id_in(range).pluck(replicable_primary_key) # rubocop:disable CodeReuse/ActiveRecord
source_ids = source.id_in(range).pluck(replicable_primary_key) # rubocop:disable CodeReuse/ActiveRecord
tracked_ids = syncable.pluck_model_ids_in_range(range) tracked_ids = syncable.pluck_model_ids_in_range(range)
untracked_ids = source_ids - tracked_ids untracked_ids = source_ids - tracked_ids
......
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
module Geo module Geo
class LfsObjectRegistryFinder < FileRegistryFinder class LfsObjectRegistryFinder < FileRegistryFinder
def replicables def replicables
current_node(fdw: false).lfs_objects lfs_objects = current_node(fdw: false).lfs_objects
local_storage_only? ? lfs_objects.with_files_stored_locally : lfs_objects
end end
def syncable def syncable
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment