mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2026-03-14 14:35:44 +01:00
Return number of ping entries, not number of urls processed.
This commit is contained in:
parent
75f6b1bd4b
commit
0490cca416
2 changed files with 6 additions and 4 deletions
6
hub.go
6
hub.go
|
|
@ -1717,8 +1717,9 @@ func (h *Hub) publishFederatedSessions() (int, *sync.WaitGroup) {
|
|||
h.mu.RLock()
|
||||
defer h.mu.RUnlock()
|
||||
|
||||
var wg sync.WaitGroup
|
||||
if len(h.federatedSessions) == 0 {
|
||||
return 0, nil
|
||||
return 0, &wg
|
||||
}
|
||||
|
||||
rooms := make(map[string]map[string][]BackendPingEntry)
|
||||
|
|
@ -1766,15 +1767,14 @@ func (h *Hub) publishFederatedSessions() (int, *sync.WaitGroup) {
|
|||
})
|
||||
}
|
||||
|
||||
var wg sync.WaitGroup
|
||||
if len(urls) == 0 {
|
||||
return 0, &wg
|
||||
}
|
||||
count := 0
|
||||
for roomId, entries := range rooms {
|
||||
count += len(entries)
|
||||
for u, e := range entries {
|
||||
wg.Add(1)
|
||||
count += len(e)
|
||||
go func(roomId string, url *url.URL, entries []BackendPingEntry) {
|
||||
defer wg.Done()
|
||||
ctx, cancel := context.WithTimeout(context.Background(), h.backendTimeout)
|
||||
|
|
|
|||
4
room.go
4
room.go
|
|
@ -956,8 +956,10 @@ func (r *Room) publishActiveSessions() (int, *sync.WaitGroup) {
|
|||
if len(urls) == 0 {
|
||||
return 0, &wg
|
||||
}
|
||||
var count int
|
||||
for u, e := range entries {
|
||||
wg.Add(1)
|
||||
count += len(e)
|
||||
go func(url *url.URL, entries []BackendPingEntry) {
|
||||
defer wg.Done()
|
||||
ctx, cancel := context.WithTimeout(context.Background(), r.hub.backendTimeout)
|
||||
|
|
@ -968,7 +970,7 @@ func (r *Room) publishActiveSessions() (int, *sync.WaitGroup) {
|
|||
}
|
||||
}(urls[u], e)
|
||||
}
|
||||
return len(entries), &wg
|
||||
return count, &wg
|
||||
}
|
||||
|
||||
func (r *Room) publishRoomMessage(message *BackendRoomMessageRequest) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue