mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-08 17:53:10 +02:00
Reduce default poll time and add DM ack clearing to standard poll
This commit is contained in:
+7
-2
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user