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