Reduce default poll time and add DM ack clearing to standard poll

This commit is contained in:
Jack Kingsman
2026-02-23 20:00:42 -08:00
parent 7306627ac7
commit b9de3b7dd7
3 changed files with 12 additions and 7 deletions
+7 -2
View File
@@ -16,6 +16,7 @@ from contextlib import asynccontextmanager
from meshcore import EventType
from app.event_handlers import cleanup_expired_acks
from app.models import Contact
from app.radio import RadioOperationBusyError, radio_manager
from app.repository import (
@@ -31,8 +32,8 @@ logger = logging.getLogger(__name__)
# Message poll task handle
_message_poll_task: asyncio.Task | None = None
# Message poll interval in seconds
MESSAGE_POLL_INTERVAL = 5
# Message poll interval in seconds (10s gives DM ACKs plenty of time to arrive)
MESSAGE_POLL_INTERVAL = 10
# Periodic advertisement task handle
_advert_task: asyncio.Task | None = None
@@ -323,6 +324,10 @@ async def _message_poll_loop():
try:
await asyncio.sleep(MESSAGE_POLL_INTERVAL)
# Clean up expired pending ACKs every poll cycle so they don't
# accumulate when no ACKs arrive (e.g. all recipients out of range).
cleanup_expired_acks()
if radio_manager.is_connected and not is_polling_paused():
mc = radio_manager.meshcore
if mc is not None: