pub async fn drain_outbox(
queue: &OutboxQueue,
client: &CloudClient,
max_items: usize,
) -> Result<(usize, usize), Error>Expand description
Drain at most max_items outbox rows. For each claimed row, invoke
the appropriate CloudClient method, then confirm on success or
mark_failed on HTTP / network failure. Returns (attempted, confirmed).
Callers should treat this as best-effort: a non-Ok return value from a SQL operation is surfaced, but upload failures themselves are absorbed into the queue’s retry counters.
Call site: hook cold-path exits (before exit(0)) and any CLI
command that has some idle time after its main work completes.