Fix race condition where initial offline video state was not written

This commit is contained in:
Gabe Kangas 2021-03-31 23:08:14 -07:00
parent 23ba9bb8be
commit 7556671afc

View file

@ -36,16 +36,16 @@ func (s *FileWriterReceiverService) SetupFileWriterReceiverService(callbacks Fil
localListenerAddress := "127.0.0.1:0"
// go func() {
listener, err := net.Listen("tcp", localListenerAddress)
if err != nil {
log.Fatalln("Unable to start internal video writing service", err)
}
listenerPort := strings.Split(listener.Addr().String(), ":")[1]
config.InternalHLSListenerPort = listenerPort
log.Traceln("Transcoder response service listening on: " + listenerPort)
go func() {
listener, err := net.Listen("tcp", localListenerAddress)
if err != nil {
log.Fatalln("Unable to start internal video writing service", err)
}
listenerPort := strings.Split(listener.Addr().String(), ":")[1]
config.InternalHLSListenerPort = listenerPort
log.Traceln("Transcoder response service listening on: " + listenerPort)
if err := http.Serve(listener, httpServer); err != nil {
log.Fatalln("Unable to start internal video writing service", err)
}