Skip to content

Commit

Permalink
Fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
muphblu committed Nov 14, 2023
1 parent f959cf0 commit 046efc5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ATI.Services.Consul/ConsulAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ internal class ConsulAdapter: IDisposable
private readonly MetricsFactory _metricsFactory = MetricsFactory.CreateHttpClientMetricsFactory(nameof(ConsulAdapter), "consul");

/// <summary>
/// Возвращает список живых сервисов
/// Возвращает список живых инстансов сервиса
/// </summary>
/// <returns></returns>
public async Task<OperationResult<List<ServiceEntry>>> GetPassingServiceInstancesAsync(string serviceName,
string environment,
bool passingOnly = true)
public async Task<OperationResult<List<ServiceEntry>>> GetPassingServiceInstancesAsync(
string serviceName,
string environment,
bool passingOnly = true)
{
try
{
using (_metricsFactory.CreateMetricsTimer(nameof(GetPassingServiceInstancesAsync)))
using (_metricsFactory.CreateMetricsTimer("/health/service/:service"))
{
var fromConsul = await _consulClient.Health.Service(serviceName, environment, passingOnly);
if (fromConsul.StatusCode == HttpStatusCode.OK)
Expand Down
1 change: 1 addition & 0 deletions ATI.Services.Consul/ConsulServiceAddressCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@ private async Task ReloadCache()
public void Dispose()
{
_updateCacheTimer.Dispose();
_consulAdapter.Dispose();
}
}

0 comments on commit 046efc5

Please sign in to comment.