mirror of
https://github.com/bluenviron/mediamtx
synced 2025-03-03 10:57:30 +00:00
This commit is contained in:
parent
1c135fb62e
commit
95f1f79b35
@ -371,7 +371,7 @@ func (pa *path) doReloadConf(newConf *conf.Path) {
|
||||
pa.confMutex.Unlock()
|
||||
|
||||
if pa.conf.HasStaticSource() {
|
||||
go pa.source.(*staticSourceHandler).reloadConf(newConf)
|
||||
pa.source.(*staticSourceHandler).reloadConf(newConf)
|
||||
}
|
||||
|
||||
if pa.conf.Record {
|
||||
|
@ -224,10 +224,18 @@ func (s *staticSourceHandler) run() {
|
||||
}
|
||||
|
||||
func (s *staticSourceHandler) reloadConf(newConf *conf.Path) {
|
||||
select {
|
||||
case s.chReloadConf <- newConf:
|
||||
case <-s.ctx.Done():
|
||||
ctx := s.ctx
|
||||
|
||||
if !s.running {
|
||||
return
|
||||
}
|
||||
|
||||
go func() {
|
||||
select {
|
||||
case s.chReloadConf <- newConf:
|
||||
case <-ctx.Done():
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
// APISourceDescribe instanceements source.
|
||||
|
Loading…
Reference in New Issue
Block a user