sender: drain backlog with ack-gated catch-up sends

This commit is contained in:
2026-02-18 01:26:43 +01:00
parent 1bdae03cc4
commit 6f359b11d3

View File

@@ -1417,6 +1417,12 @@ static void sender_loop() {
} }
} }
} }
// Catch-up mode: when backlog exists, send next queued batch without waiting
// for the regular 30s cadence.
if (!g_batch_ack_pending && g_batch_count > 1) {
send_meter_batch(last_sample_ts());
}
} else { } else {
if (!g_batch_ack_pending && now_ms - g_last_sync_request_ms >= SYNC_REQUEST_INTERVAL_MS) { if (!g_batch_ack_pending && now_ms - g_last_sync_request_ms >= SYNC_REQUEST_INTERVAL_MS) {
g_last_sync_request_ms = now_ms; g_last_sync_request_ms = now_ms;