mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2025-10-07 01:03:07 +08:00
Add exec launch time to debug
This commit is contained in:
@@ -64,6 +64,8 @@ func Handle(url string) (streamer.Producer, error) {
|
|||||||
|
|
||||||
log.Debug().Str("url", url).Msg("[exec] run")
|
log.Debug().Str("url", url).Msg("[exec] run")
|
||||||
|
|
||||||
|
ts := time.Now()
|
||||||
|
|
||||||
if err := cmd.Start(); err != nil {
|
if err := cmd.Start(); err != nil {
|
||||||
log.Error().Err(err).Str("url", url).Msg("[exec]")
|
log.Error().Err(err).Str("url", url).Msg("[exec]")
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -75,6 +77,7 @@ func Handle(url string) (streamer.Producer, error) {
|
|||||||
log.Error().Str("url", url).Msg("[exec] timeout")
|
log.Error().Str("url", url).Msg("[exec] timeout")
|
||||||
return nil, errors.New("timeout")
|
return nil, errors.New("timeout")
|
||||||
case prod := <-ch:
|
case prod := <-ch:
|
||||||
|
log.Debug().Stringer("launch", time.Since(ts)).Msg("[exec] run")
|
||||||
return prod, nil
|
return prod, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user