(backend) add lobby cache clearing method for room and participant

Introduce new method on lobby system to clear lobby cache for specific
room and participant combinations.

Enables targeted cleanup of lobby state when participants leave or are
removed, improving cache management and preventing stale lobby entries.
This commit is contained in:
lebaudantoine
2025-08-26 16:18:04 +02:00
committed by aleb_the_flash
parent 6c633b1ecb
commit 84e62246b7
2 changed files with 38 additions and 0 deletions

View File

@@ -342,3 +342,9 @@ class LobbyService:
return
cache.delete_many(keys)
def clear_participant_cache(self, room_id: UUID, participant_id: str) -> None:
"""Clear a given participant entry from the cache for a specific room."""
cache_key = self._get_cache_key(room_id, participant_id)
cache.delete(cache_key)