collect: revert last_broadcast to snapshot, not payload
Diffs should always be computed against the last full snapshot, not the last broadcast payload. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -93,7 +93,7 @@ def run(args: argparse.Namespace) -> None:
|
|||||||
payload = jay_diff_full(last_broadcast, snapshot, combine_upd_add=True)
|
payload = jay_diff_full(last_broadcast, snapshot, combine_upd_add=True)
|
||||||
else:
|
else:
|
||||||
payload = snapshot
|
payload = snapshot
|
||||||
last_broadcast = payload
|
last_broadcast = snapshot
|
||||||
network.broadcast(payload, push_clients, push_lock)
|
network.broadcast(payload, push_clients, push_lock)
|
||||||
log.info("Record #%d saved at %s", len(store["records"]), snapshot["ts"])
|
log.info("Record #%d saved at %s", len(store["records"]), snapshot["ts"])
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|||||||
Reference in New Issue
Block a user