private async Task <IDedupStoreHttpClient> CreateDomainDedupStoreHttpClientAsync(Context context)
        {
            var client = DedupStoreHttpClientFactory.GetDomainClient(_backingStoreBaseUri, _httpClientFactory);
            await ArtifactHttpClientErrorDetectionStrategy.ExecuteAsync(
                context,
                "VerifyDomainBlobStoreHttpClientConnection",
                () => _httpClientFactory.VerifyConnectionAsync(client),
                CancellationToken.None).ConfigureAwait(false);

            _tracer.Debug(context, $"Verified connection to {_backingStoreBaseUri} with SessionId=[{_httpClientFactory.ClientSettings.SessionId}], Domain=[{_domain.Serialize()}]");

            return(new DomainHttpClientWrapper(_domain, client));
        }
Esempio n. 2
0
        /// <inheritdoc />
        public async Task <IDedupStoreHttpClient> CreateDedupStoreHttpClientAsync(Context context)
        {
            var client = DedupStoreHttpClientFactory.GetClient(_backingStoreBaseUri, _httpClientFactory);
            await ArtifactHttpClientErrorDetectionStrategy.ExecuteAsync(
                context,
                "VerifyDedupStoreHttpClientConnection",
                () => _httpClientFactory.VerifyConnectionAsync(client),
                CancellationToken.None).ConfigureAwait(false);

            context.TraceMessage(
                Severity.Debug, $"Verified connection to {_backingStoreBaseUri} with SessionId=[{_httpClientFactory.ClientSettings.SessionId}]");
            return(client);
        }
        /// <inheritdoc />
        public async Task <IDedupStoreHttpClient> CreateDedupStoreHttpClientAsync(Context context)
        {
            if (_domain.Equals(WellKnownDomainIds.DefaultDomainId))
            {
                var client = DedupStoreHttpClientFactory.GetClient(_backingStoreBaseUri, _httpClientFactory);
                await ArtifactHttpClientErrorDetectionStrategy.ExecuteAsync(
                    context,
                    "VerifyDedupStoreHttpClientConnection",
                    () => _httpClientFactory.VerifyConnectionAsync(client),
                    CancellationToken.None).ConfigureAwait(false);

                _tracer.Debug(context, $"Verified connection to {_backingStoreBaseUri} with SessionId=[{_httpClientFactory.ClientSettings.SessionId}], Domain=[Default]");
                return(client);
            }

            return(await CreateDomainDedupStoreHttpClientAsync(context));
        }