forked from External/mediamtx
This commit is contained in:
parent
1c135fb62e
commit
95f1f79b35
2 changed files with 12 additions and 4 deletions
|
|
@ -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) {
|
||||
ctx := s.ctx
|
||||
|
||||
if !s.running {
|
||||
return
|
||||
}
|
||||
|
||||
go func() {
|
||||
select {
|
||||
case s.chReloadConf <- newConf:
|
||||
case <-s.ctx.Done():
|
||||
case <-ctx.Done():
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
// APISourceDescribe instanceements source.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue