From 6f359b11d3cace45b3e229afab91074a333bd49d Mon Sep 17 00:00:00 2001 From: acidburns Date: Wed, 18 Feb 2026 01:26:43 +0100 Subject: [PATCH] sender: drain backlog with ack-gated catch-up sends --- src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index cec2898..30010aa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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 { if (!g_batch_ack_pending && now_ms - g_last_sync_request_ms >= SYNC_REQUEST_INTERVAL_MS) { g_last_sync_request_ms = now_ms;