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()
|
pa.confMutex.Unlock()
|
||||||
|
|
||||||
if pa.conf.HasStaticSource() {
|
if pa.conf.HasStaticSource() {
|
||||||
go pa.source.(*staticSourceHandler).reloadConf(newConf)
|
pa.source.(*staticSourceHandler).reloadConf(newConf)
|
||||||
}
|
}
|
||||||
|
|
||||||
if pa.conf.Record {
|
if pa.conf.Record {
|
||||||
|
|
|
||||||
|
|
@ -224,10 +224,18 @@ func (s *staticSourceHandler) run() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *staticSourceHandler) reloadConf(newConf *conf.Path) {
|
func (s *staticSourceHandler) reloadConf(newConf *conf.Path) {
|
||||||
select {
|
ctx := s.ctx
|
||||||
case s.chReloadConf <- newConf:
|
|
||||||
case <-s.ctx.Done():
|
if !s.running {
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
select {
|
||||||
|
case s.chReloadConf <- newConf:
|
||||||
|
case <-ctx.Done():
|
||||||
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
// APISourceDescribe instanceements source.
|
// APISourceDescribe instanceements source.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue