exit after panic (#1392)

* let panics crash

* Revert "let panics crash"

This reverts commit 8027cccadd760bd6588ba7a0c699f80b9fda1f09.

* catch and log panics then os.Exit

* Recover only recovers, caller can exit

* only exit on pacic, still need Recover calls in goroutines
This commit is contained in:
Dan McFaul
2023-02-09 16:33:22 -07:00
committed by GitHub
parent bee4bcc158
commit ad7e075c18
5 changed files with 40 additions and 11 deletions
+7 -1
View File
@@ -3,6 +3,7 @@ package service
import (
"context"
"fmt"
"os"
"sync"
"time"
@@ -479,7 +480,12 @@ func (r *RoomManager) rtcSessionWorker(room *rtc.Room, participant types.LocalPa
pLogger.Debugw("RTC session finishing")
requestSource.Close()
}()
defer rtc.Recover(pLogger)
defer func() {
if r := rtc.Recover(pLogger); r != nil {
os.Exit(1)
}
}()
// send first refresh for cases when client token is close to expiring
_ = r.refreshToken(participant)