mirror of https://bitbucket.org/ausocean/av.git
Load broadcast state on startup
This commit is contained in:
parent
b68da55793
commit
f9cfbda44f
|
@ -304,7 +304,7 @@ func (m *broadcastManager) createOrUpdate(broadcast Broadcast) error {
|
||||||
|
|
||||||
switch broadcast.status {
|
switch broadcast.status {
|
||||||
case statusActive, statusPlay, statusCreate:
|
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]
|
signal, ok := m.slateExitSignals[broadcast.mac]
|
||||||
if ok {
|
if ok {
|
||||||
close(signal)
|
close(signal)
|
||||||
|
@ -375,6 +375,14 @@ func main() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("could not create new broadcast manager", "error", err)
|
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("/recv", m.recv)
|
||||||
http.HandleFunc("/control", m.control)
|
http.HandleFunc("/control", m.control)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue