(backend) add lobby cache clearing method for meeting conclusion

Implement new lobby service method to clear all participant entries from cache.

Lays foundation for upcoming feature where participant permissions reset when
meetings end. Currently introduces only the cache clearing functionality;
event handling for meeting conclusion will be implemented in future commits
This commit is contained in:
lebaudantoine
2025-03-06 01:53:58 +01:00
committed by aleb_the_flash
parent 356797d326
commit 2168643fd4
2 changed files with 70 additions and 0 deletions

View File

@@ -356,3 +356,14 @@ class LobbyService:
raise LobbyNotificationError("Failed to notify room participants") from e
finally:
await lkapi.aclose()
def clear_room_cache(self, room_id: UUID) -> None:
"""Clear all participant entries from the cache for a specific room."""
pattern = self._get_cache_key(room_id, "*")
keys = cache.keys(pattern)
if not keys:
return
cache.delete_many(keys)