Fix Kafka retry seek, bound buffers, and cut hot-path CPU/memory waste (Phases 41–44).
Stop consumers from committing past failed offsets, harden Rabbit/DataLake/gateway backpressure, dispose JsonDocument/MinIO correctly, and batch expensive DB/HTTP paths. Track progress in docs/performance.
This commit is contained in:
@@ -34,6 +34,7 @@ public class ThresholdCacheLoader : IHostedService
|
||||
{
|
||||
var cache = _redis.GetDatabase();
|
||||
var batch = cache.CreateBatch();
|
||||
var setTasks = new List<Task>(thresholds.Count);
|
||||
|
||||
foreach (var t in thresholds)
|
||||
{
|
||||
@@ -45,10 +46,11 @@ public class ThresholdCacheLoader : IHostedService
|
||||
t.WarningHigh,
|
||||
t.CriticalHigh
|
||||
});
|
||||
_ = batch.StringSetAsync($"threshold:{t.ObservationCode}", json);
|
||||
setTasks.Add(batch.StringSetAsync($"threshold:{t.ObservationCode}", json));
|
||||
}
|
||||
|
||||
batch.Execute();
|
||||
await Task.WhenAll(setTasks);
|
||||
_logger.LogInformation("Loaded {Count} alert thresholds into Redis cache", thresholds.Count);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user