Sync time periodically

This commit is contained in:
Jack Kingsman
2026-01-14 16:22:50 -08:00
parent 92e7cd24e6
commit 91c9258275
4 changed files with 70 additions and 4 deletions
+4
View File
@@ -18,6 +18,7 @@ from app.radio_sync import (
stop_message_polling,
stop_periodic_sync,
sync_and_offload_all,
sync_radio_time,
)
from app.routers import channels, contacts, health, messages, packets, radio, read_state, settings, ws
@@ -37,6 +38,9 @@ async def lifespan(app: FastAPI):
if radio_manager.meshcore:
register_event_handlers(radio_manager.meshcore)
# Sync radio clock with system time
await sync_radio_time()
# Sync contacts/channels from radio to DB and clear radio
logger.info("Syncing and offloading radio data...")
result = await sync_and_offload_all()