Pass backend when fetching room for managing virtual sessions.

The internal room id is different depending on the backend.
This commit is contained in:
Joachim Bauch
2021-04-23 14:39:42 +02:00
parent d21ace3114
commit a5faca00cd
2 changed files with 17 additions and 16 deletions
+14
View File
@@ -47,6 +47,20 @@ const (
testTimeout = 10 * time.Second
)
// Only used for testing.
func (h *Hub) getRoom(id string) *Room {
h.ru.RLock()
defer h.ru.RUnlock()
// TODO: The same room might exist on different backends.
for _, room := range h.rooms {
if room.Id() == id {
return room
}
}
return nil
}
func getTestConfig(server *httptest.Server) (*goconf.ConfigFile, error) {
config := goconf.NewConfigFile()
u, err := url.Parse(server.URL)