mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-07-13 21:31:18 +02:00
Remove unused endpoint and fix stale slot retry problems
This commit is contained in:
@@ -306,6 +306,15 @@ class RadioManager:
|
||||
self._channel_slot_by_key.move_to_end(normalized_key)
|
||||
self._channel_key_by_slot[slot] = normalized_key
|
||||
|
||||
def invalidate_cached_channel_slot(self, channel_key: str) -> None:
|
||||
"""Drop any cached slot assignment for a channel key."""
|
||||
normalized_key = channel_key.upper()
|
||||
slot = self._channel_slot_by_key.pop(normalized_key, None)
|
||||
if slot is None:
|
||||
return
|
||||
if self._channel_key_by_slot.get(slot) == normalized_key:
|
||||
self._channel_key_by_slot.pop(slot, None)
|
||||
|
||||
def get_channel_send_cache_snapshot(self) -> list[tuple[str, int]]:
|
||||
"""Return the current channel send cache contents in LRU order."""
|
||||
return list(self._channel_slot_by_key.items())
|
||||
|
||||
@@ -112,7 +112,10 @@ async def send_channel_message_with_effective_scope(
|
||||
msg=text,
|
||||
timestamp=timestamp_bytes,
|
||||
)
|
||||
radio_manager.note_channel_slot_used(channel_key)
|
||||
if send_result.type == EventType.ERROR:
|
||||
radio_manager.invalidate_cached_channel_slot(channel_key)
|
||||
else:
|
||||
radio_manager.note_channel_slot_used(channel_key)
|
||||
return send_result
|
||||
finally:
|
||||
if override_scope and override_scope != baseline_scope:
|
||||
|
||||
Reference in New Issue
Block a user