on set new states, send confirmation message

This commit is contained in:
Bel LaPointe
2022-01-11 22:21:45 -05:00
parent e963162303
commit 6569631928

View File

@@ -89,6 +89,9 @@ func setNewStates(states map[config.State]struct{}) {
conf.States = newstates
log.Printf("updating config new states: %+v", conf)
config.Set(conf)
if err := sendNewStates(conf.States); err != nil {
log.Printf("failed to send new states %+v: %v", conf.States, err)
}
}
func email() error {
@@ -231,3 +234,8 @@ func sendJob(job broker.Job) error {
sender := message.NewMatrix()
return sender.Send(job.FormatMultilineText())
}
func sendNewStates(states []config.State) error {
sender := message.NewMatrix()
return sender.Send(fmt.Sprintf("now searching for loads from: %+v", states))
}