Commit 5d90de1f authored by Valery Sizov's avatar Valery Sizov

Add missing memoization for ContainerRepository client

parent 25918ea2
...@@ -5,6 +5,7 @@ require 'tempfile' ...@@ -5,6 +5,7 @@ require 'tempfile'
module Geo module Geo
class ContainerRepositorySync class ContainerRepositorySync
include ExclusiveLeaseGuard include ExclusiveLeaseGuard
include Gitlab::Utils::StrongMemoize
LEASE_TIMEOUT = 1.hour.freeze LEASE_TIMEOUT = 1.hour.freeze
...@@ -96,10 +97,12 @@ module Geo ...@@ -96,10 +97,12 @@ module Geo
# The client for primary registry # The client for primary registry
def client def client
ContainerRegistry::Client.new( strong_memoize(:client) do
Gitlab.config.geo.registry_replication.primary_api_url, ContainerRegistry::Client.new(
token: ::Auth::ContainerRegistryAuthenticationService.pull_access_token(name) Gitlab.config.geo.registry_replication.primary_api_url,
) token: ::Auth::ContainerRegistryAuthenticationService.pull_access_token(name)
)
end
end end
end end
end end
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