Remove Geo::RegsitryFinder#current_node_fdw method

Since GitLab 13.2 we don't rely on FDW query/models
parent a0adf4a2
......@@ -3,7 +3,7 @@
module Geo
class ContainerRepositoryRegistryFinder < RegistryFinder
def count_syncable
current_node_non_fdw.container_repositories.count
container_repositories.count
end
def count_synced
......@@ -19,7 +19,7 @@ module Geo
end
def find_registry_differences(range)
source_ids = current_node_non_fdw.container_repositories.id_in(range).pluck_primary_key
source_ids = container_repositories.id_in(range).pluck_primary_key
tracked_ids = Geo::ContainerRepositoryRegistry.pluck_model_ids_in_range(range)
untracked_ids = source_ids - tracked_ids
......@@ -63,5 +63,11 @@ module Geo
.limit(batch_size)
end
# rubocop:enable CodeReuse/ActiveRecord
private
def container_repositories
current_node.container_repositories
end
end
end
......@@ -66,7 +66,7 @@ module Geo
private
def designs
current_node_non_fdw.designs
current_node.designs
end
def registries
......
......@@ -151,7 +151,7 @@ module Geo
end
def local_storage_only?
!current_node(fdw: false)&.sync_object_storage
!current_node&.sync_object_storage
end
end
end
......@@ -3,13 +3,17 @@
module Geo
class LfsObjectRegistryFinder < FileRegistryFinder
def replicables
lfs_objects = current_node(fdw: false).lfs_objects
local_storage_only? ? lfs_objects.with_files_stored_locally : lfs_objects
end
def syncable
Geo::LfsObjectRegistry
end
private
def lfs_objects
current_node.lfs_objects
end
end
end
......@@ -14,18 +14,8 @@ module Geo
private
def current_node(fdw: true)
fdw ? current_node_fdw : current_node_non_fdw
end
def current_node_fdw
strong_memoize(:current_node_fdw) do
Geo::Fdw::GeoNode.find(current_node_id) if current_node_id
end
end
def current_node_non_fdw
strong_memoize(:current_node_non_fdw) do
def current_node
strong_memoize(:current_node) do
GeoNode.find(current_node_id) if current_node_id
end
end
......
......@@ -3,8 +3,6 @@
require 'spec_helper'
RSpec.describe Geo::FileRegistryFinder, :geo do
include ::EE::GeoHelpers
context 'with abstract methods' do
%w[
replicables
......
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