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:
@@ -1,10 +1,16 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
public class LocalAlertService : ILocalAlertService
|
||||
{
|
||||
private readonly GatewayDbContext _db;
|
||||
private readonly GatewayOptions _gateway;
|
||||
|
||||
public LocalAlertService(GatewayDbContext db) => _db = db;
|
||||
public LocalAlertService(GatewayDbContext db, IOptions<GatewayOptions> gateway)
|
||||
{
|
||||
_db = db;
|
||||
_gateway = gateway.Value;
|
||||
}
|
||||
|
||||
public async Task<LocalClinicalAlert> AcknowledgeAsync(
|
||||
Guid id, AcknowledgeAlertRequest req, string clinicianId)
|
||||
@@ -26,7 +32,8 @@ public class LocalAlertService : ILocalAlertService
|
||||
clinicianId,
|
||||
acknowledgedAt = alert.AcknowledgedAt,
|
||||
req.Note
|
||||
}, $"ack:{alert.ClientAlertId}:{alert.AcknowledgedAt:o}", alert.EncounterId, alert.AcknowledgedAt!.Value);
|
||||
}, $"ack:{alert.ClientAlertId}:{alert.AcknowledgedAt:o}", alert.EncounterId, alert.AcknowledgedAt!.Value,
|
||||
_gateway.MaxBufferedSyncItems);
|
||||
|
||||
await _db.SaveChangesAsync();
|
||||
return alert;
|
||||
@@ -50,7 +57,8 @@ public class LocalAlertService : ILocalAlertService
|
||||
clinicianId = alert.AcknowledgedBy,
|
||||
resolvedAt = alert.ResolvedAt,
|
||||
note = (string?)null
|
||||
}, $"resolve:{alert.ClientAlertId}", alert.EncounterId, alert.ResolvedAt!.Value);
|
||||
}, $"resolve:{alert.ClientAlertId}", alert.EncounterId, alert.ResolvedAt!.Value,
|
||||
_gateway.MaxBufferedSyncItems);
|
||||
|
||||
await _db.SaveChangesAsync();
|
||||
return alert;
|
||||
|
||||
Reference in New Issue
Block a user