Overhaul frontend organization and pause message polling during repeater operations

This commit is contained in:
Jack Kingsman
2026-01-10 16:27:15 -08:00
parent e559d6cd47
commit b0ab2bcb32
15 changed files with 1817 additions and 1131 deletions
+16 -1
View File
@@ -12,6 +12,7 @@ don't work reliably.
import asyncio
import logging
import time
from contextlib import asynccontextmanager
from meshcore import EventType
@@ -28,6 +29,20 @@ _message_poll_task: asyncio.Task | None = None
# Message poll interval in seconds
MESSAGE_POLL_INTERVAL = 5
# Flag to pause polling during repeater operations
_polling_paused: bool = False
@asynccontextmanager
async def pause_polling():
"""Context manager to pause message polling during repeater operations."""
global _polling_paused
_polling_paused = True
try:
yield
finally:
_polling_paused = False
# Background task handle
_sync_task: asyncio.Task | None = None
@@ -276,7 +291,7 @@ async def _message_poll_loop():
try:
await asyncio.sleep(MESSAGE_POLL_INTERVAL)
if radio_manager.is_connected:
if radio_manager.is_connected and not _polling_paused:
await poll_for_messages()
except asyncio.CancelledError: