Beispiel #1
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));
        }