send mail if debug on

This commit is contained in:
shoopea
2023-08-01 09:35:45 +02:00
parent 8ecde237b1
commit 9c152943cd
4 changed files with 16 additions and 13 deletions

View File

@@ -181,8 +181,10 @@ func (c *Config) Run() {
for _, a := range cfg.apps {
wg.Add(1)
go func(app *App) {
if err := app.Run(e.startTime); err != nil {
if sched, err := app.Run(e.startTime); err != nil {
e.AddItem(fmt.Sprintf(" - App : Error running %s (%s)", app.name, err))
} else if *debug {
e.AddItem(fmt.Sprintf(" - App : Success backing up %s (%s)", app.name, sched))
}
wg.Done()
}(a)