diff --git a/cmd/vidforward/main.go b/cmd/vidforward/main.go index cd49d0b6..c7aa8b57 100644 --- a/cmd/vidforward/main.go +++ b/cmd/vidforward/main.go @@ -304,7 +304,7 @@ func (m *broadcastManager) createOrUpdate(broadcast Broadcast) error { switch broadcast.status { case statusActive, statusPlay, statusCreate: - m.log.Info("updating configuration for mac","mac",broadcast.mac) + m.log.Info("updating configuration for mac", "mac", broadcast.mac) signal, ok := m.slateExitSignals[broadcast.mac] if ok { close(signal) @@ -375,6 +375,14 @@ func main() { if err != nil { log.Fatal("could not create new broadcast manager", "error", err) } + + // Try to load any previous state. There may be a previous state if the + // watchdog did a process restart. + err = m.load() + if err != nil { + log.Warning("could not load previous state", "error", err) + } + http.HandleFunc("/recv", m.recv) http.HandleFunc("/control", m.control)