wide-tailor-66933
07/16/2025, 5:24 AMasync def yeah():
async with api.LiveKitAPI(url=cfg.LIVEKIT_URL, api_key=cfg.LIVEKIT_API_KEY, api_secret=cfg.LIVEKIT_API_SECRET) as lkapi:
rooms_response = await lkapi.room.list_rooms(api.ListRoomsRequest())
container = {}
for room in rooms_response.rooms:
container[room.name] = room.num_participants
print(room.name, room.num_participants)
return container
Why do the number of participants fluctuate, usually changing from 0 to 2 or 2 to 0? Any reason why? My application relies on this to check empty room and turns out the API response fluctuates a lot. From my simple observation, the first 10 rooms always returns nonzero, the rest is zero. If I query with names, api.ListRoomsRequest(names=["room-123"]) , this one never fluctuates