mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2026-03-14 14:35:44 +01:00
Pass contexts when creating / starting MCUs.
This commit is contained in:
parent
f73ad7b508
commit
c6cbe88d0e
10 changed files with 65 additions and 61 deletions
|
|
@ -22,6 +22,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"flag"
|
||||
|
|
@ -240,9 +241,11 @@ func main() {
|
|||
mcuRetryTimer := time.NewTimer(mcuRetry)
|
||||
mcuTypeLoop:
|
||||
for {
|
||||
// Context should be cancelled on signals but need a way to differentiate later.
|
||||
ctx := context.TODO()
|
||||
switch mcuType {
|
||||
case signaling.McuTypeJanus:
|
||||
mcu, err = signaling.NewMcuJanus(mcuUrl, config)
|
||||
mcu, err = signaling.NewMcuJanus(ctx, mcuUrl, config)
|
||||
signaling.UnregisterProxyMcuStats()
|
||||
signaling.RegisterJanusMcuStats()
|
||||
case signaling.McuTypeProxy:
|
||||
|
|
@ -253,7 +256,7 @@ func main() {
|
|||
log.Fatal("Unsupported MCU type: ", mcuType)
|
||||
}
|
||||
if err == nil {
|
||||
err = mcu.Start()
|
||||
err = mcu.Start(ctx)
|
||||
if err != nil {
|
||||
log.Printf("Could not create %s MCU: %s", mcuType, err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue