add explicit room exists servicestore op (#4175)

This commit is contained in:
Paul Wells
2025-12-17 22:14:06 -08:00
committed by GitHub
parent 39bd077d24
commit 0a82438687
6 changed files with 185 additions and 2 deletions
+10
View File
@@ -84,6 +84,16 @@ func (s *LocalStore) LoadRoom(_ context.Context, roomName livekit.RoomName, incl
return room, internal, nil
}
func (s *LocalStore) RoomExists(ctx context.Context, roomName livekit.RoomName) (bool, error) {
_, _, err := s.LoadRoom(ctx, roomName, false)
if err == ErrRoomNotFound {
return false, nil
} else if err != nil {
return false, err
}
return true, nil
}
func (s *LocalStore) ListRooms(_ context.Context, roomNames []livekit.RoomName) ([]*livekit.Room, error) {
s.lock.RLock()
defer s.lock.RUnlock()