mirror of
https://github.com/bluenviron/mediamtx
synced 2025-02-13 09:58:50 +00:00
fix race condition
This commit is contained in:
parent
e6238694af
commit
f32d69a93d
@ -297,7 +297,6 @@ func newAPI(
|
||||
parent: parent,
|
||||
}
|
||||
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
router := gin.New()
|
||||
router.NoRoute(a.mwLog)
|
||||
group := router.Group("/", a.mwLog)
|
||||
|
@ -7,6 +7,7 @@ import (
|
||||
"reflect"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"gopkg.in/alecthomas/kingpin.v2"
|
||||
|
||||
"github.com/aler9/rtsp-simple-server/internal/conf"
|
||||
@ -64,6 +65,8 @@ func New(args []string) (*Core, bool) {
|
||||
// do not check for errors
|
||||
rlimit.Raise()
|
||||
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
|
||||
ctx, ctxCancel := context.WithCancel(context.Background())
|
||||
|
||||
p := &Core{
|
||||
|
@ -100,7 +100,6 @@ func (s *hlsServer) close() {
|
||||
func (s *hlsServer) run() {
|
||||
defer s.wg.Done()
|
||||
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
router := gin.New()
|
||||
router.NoRoute(s.onRequest)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user