Skip to content

Commit

Permalink
new strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillKurdyukov committed Aug 15, 2024
1 parent cc5a789 commit 7b5cae2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions slo/src/Internal/SloContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ public async Task Run(RunConfig runConfig)

var errorsGauge = metricFactory.CreateGauge("errors", "amount of errors", new[] { "class", "in" });

var writeLimiter = Policy.RateLimit(runConfig.WriteRps, TimeSpan.FromSeconds(1), runConfig.WriteRps);
var readLimiter = Policy.RateLimit(runConfig.ReadRps, TimeSpan.FromSeconds(1), runConfig.ReadRps);
var writeLimiter = Policy.RateLimit(runConfig.WriteRps, TimeSpan.FromSeconds(1), 10);
var readLimiter = Policy.RateLimit(runConfig.ReadRps, TimeSpan.FromSeconds(1), 10);

var cancellationTokenSource = new CancellationTokenSource();
cancellationTokenSource.CancelAfter(TimeSpan.FromSeconds(runConfig.ShutdownTime));
Expand Down Expand Up @@ -189,7 +189,7 @@ Task ShootingTask(RateLimitPolicy rateLimitPolicy, string shootingName,
_logger.LogInformation(e, "Waiting {ShootingName} task, count active tasks: {}", shootingName,
Interlocked.Read(ref activeTasks));
await Task.Delay(990, cancellationTokenSource.Token);
await Task.Delay(e.RetryAfter, cancellationTokenSource.Token);
}
}
Expand Down

0 comments on commit 7b5cae2

Please sign in to comment.