server: remove diff switch, always send diffs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+3
-6
@@ -6,9 +6,10 @@ from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
|
||||
from . import log_config, network, we_connect
|
||||
from jaydiff.diff import diff_full as jay_diff_full
|
||||
|
||||
from .data_model import ALL_DOMAINS, apply_procedural, extract_all
|
||||
from .storage_helpers import auto_out_path, load_last_24h_records, load_store, save_store
|
||||
from jaydiff.diff import diff_full as jay_diff_full
|
||||
|
||||
from volkswagencarnet.vw_exceptions import AuthenticationError
|
||||
|
||||
@@ -46,7 +47,6 @@ def run(args: argparse.Namespace) -> None:
|
||||
out = auto_out_path(logs_dir, vin)
|
||||
|
||||
push_clients, push_lock, push_store_ref = network.start_push_server(args.host, args.port)
|
||||
push_store_ref["diff_mode"] = args.diff
|
||||
push_store_ref["preloaded"] = load_last_24h_records(logs_dir, vin)
|
||||
for _r in push_store_ref["preloaded"]:
|
||||
if "procedural" not in _r:
|
||||
@@ -89,10 +89,7 @@ def run(args: argparse.Namespace) -> None:
|
||||
snapshot = apply_procedural(snapshot)
|
||||
store["records"].append(snapshot)
|
||||
save_store(out, store, args.max_records)
|
||||
if args.diff:
|
||||
payload = jay_diff_full(last_broadcast, snapshot, combine_upd_add=True)
|
||||
else:
|
||||
payload = snapshot
|
||||
payload = jay_diff_full(last_broadcast, snapshot, combine_upd_add=True)
|
||||
last_broadcast = snapshot
|
||||
network.broadcast(payload, push_clients, push_lock)
|
||||
log.info("Record #%d saved at %s", len(store["records"]), snapshot["ts"])
|
||||
|
||||
Reference in New Issue
Block a user