23 lines
358 B
Go
Raw Normal View History

2021-04-11 15:02:27 +02:00
package internal
import (
"errors"
"fmt"
)
2021-04-11 15:02:27 +02:00
func RunCron() error {
c := GetConfig()
var errs []error
2021-04-16 22:02:25 +02:00
for name, l := range c.Locations {
l.name = name
2021-04-12 00:17:29 +02:00
if err := l.RunCron(); err != nil {
errs = append(errs, err)
2021-04-11 15:02:27 +02:00
}
}
if len(errs) > 0 {
return fmt.Errorf("Encountered errors during cron process:\n%w", errors.Join(errs...))
}
2021-04-11 15:02:27 +02:00
return nil
}