on set new states, send confirmation message
This commit is contained in:
8
main.go
8
main.go
@@ -89,6 +89,9 @@ func setNewStates(states map[config.State]struct{}) {
|
|||||||
conf.States = newstates
|
conf.States = newstates
|
||||||
log.Printf("updating config new states: %+v", conf)
|
log.Printf("updating config new states: %+v", conf)
|
||||||
config.Set(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 {
|
func email() error {
|
||||||
@@ -231,3 +234,8 @@ func sendJob(job broker.Job) error {
|
|||||||
sender := message.NewMatrix()
|
sender := message.NewMatrix()
|
||||||
return sender.Send(job.FormatMultilineText())
|
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))
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user