From f98330f05a5c877f717f6a1ce82edfa5e18cb8f6 Mon Sep 17 00:00:00 2001 From: KirillKurdyukov Date: Wed, 14 Aug 2024 17:27:41 +0300 Subject: [PATCH] fix linter --- slo/src/AdoNet/SloContext.cs | 5 ++--- slo/src/Internal/Jobs/Job.cs | 1 - slo/src/Internal/SloContext.cs | 4 ++-- slo/src/TableService/SloContext.cs | 1 - 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/slo/src/AdoNet/SloContext.cs b/slo/src/AdoNet/SloContext.cs index 2566edc4..5334d3d7 100644 --- a/slo/src/AdoNet/SloContext.cs +++ b/slo/src/AdoNet/SloContext.cs @@ -1,4 +1,3 @@ -using System.Diagnostics; using Internal; using Internal.Cli; using Polly; @@ -69,7 +68,7 @@ protected override async Task Create(YdbDataSource client, string createTableSql { context["errorsGauge"] = errorsGauge; } - + var policyResult = await _policy.ExecuteAndCaptureAsync(async _ => { await using var ydbConnection = await dataSource.OpenConnectionAsync(); @@ -84,7 +83,7 @@ protected override async Task Create(YdbDataSource client, string createTableSql return await ydbCommand.ExecuteScalarAsync(); }, context); - + return (policyResult.Context.TryGetValue("RetryCount", out var countAttempts) ? (int)countAttempts : 1, ((YdbException)policyResult.FinalException)?.Code ?? StatusCode.Success, policyResult.Result); } diff --git a/slo/src/Internal/Jobs/Job.cs b/slo/src/Internal/Jobs/Job.cs index da7e37b4..b4a023a1 100644 --- a/slo/src/Internal/Jobs/Job.cs +++ b/slo/src/Internal/Jobs/Job.cs @@ -1,6 +1,5 @@ using System.Diagnostics; using Prometheus; -using Ydb.Sdk; namespace Internal.Jobs; diff --git a/slo/src/Internal/SloContext.cs b/slo/src/Internal/SloContext.cs index ef9696f2..4c0fca01 100644 --- a/slo/src/Internal/SloContext.cs +++ b/slo/src/Internal/SloContext.cs @@ -138,7 +138,7 @@ public async Task Run(RunConfig runConfig) await prometheus.StopAsync(); await MetricReset(promPgwEndpoint); - + _logger.LogInformation("Run task is finished"); return; @@ -242,7 +242,7 @@ Task ShootingTask(RateLimitPolicy rateLimitPolicy, string shootingName, return (attempts, code); } - + private async Task MetricReset(string promPgwEndpoint) { var deleteUri = $"{promPgwEndpoint}/job/{JobName}"; diff --git a/slo/src/TableService/SloContext.cs b/slo/src/TableService/SloContext.cs index 4d09a0db..f9c0e5e1 100644 --- a/slo/src/TableService/SloContext.cs +++ b/slo/src/TableService/SloContext.cs @@ -1,6 +1,5 @@ using Internal; using Internal.Cli; -using Microsoft.Extensions.Logging; using Prometheus; using Ydb.Sdk; using Ydb.Sdk.Services.Table;