Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/ServiceControl/CompositeViews/Messages/ScatterGatherApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ protected ScatterGatherApi(TDataStore store, Settings settings, Func<HttpClient>
DataStore = store;
Settings = settings;
HttpClientFactory = httpClientFactory;
Logger = LogManager.GetLogger(GetType());
}

protected TDataStore DataStore { get; }
Expand Down Expand Up @@ -124,12 +125,18 @@ async Task<QueryResult<TOut>> FetchAndParse(HttpRequestMessage currentRequest, U
catch (HttpRequestException httpRequestException)
{
DisableRemoteInstance(remoteUri);
logger.Warn($"An HttpRequestException occurred when quering remote instance at {remoteUri}. The instance at uri: {remoteUri} will be temporarily disabled.", httpRequestException);
Logger.Warn($"An HttpRequestException occurred when quering remote instance at {remoteUri}. The instance at uri: {remoteUri} will be temporarily disabled.",
httpRequestException);
return QueryResult<TOut>.Empty();
}
catch (OperationCanceledException)
{
Logger.Warn($"Failed to query remote instance at {remoteUri} due to a timeout");
return QueryResult<TOut>.Empty();
}
catch (Exception exception)
{
logger.Warn($"Failed to query remote instance at {remoteUri}.", exception);
Logger.Warn($"Failed to query remote instance at {remoteUri}.", exception);
return QueryResult<TOut>.Empty();
}
}
Expand Down Expand Up @@ -167,7 +174,7 @@ static async Task<QueryResult<TOut>> ParseResult(HttpResponseMessage responseMes
}
}

static readonly ILog logger = LogManager.GetLogger(typeof(ScatterGatherApi<TDataStore, TIn, TOut>));
readonly ILog Logger;
}

abstract class ScatterGatherApiNoInput<TStore, TOut> : ScatterGatherApi<TStore, NoInput, TOut>
Expand Down