You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
autorestic/internal/cron.go

23 lines
358 B

4 years ago
package internal
import (
"errors"
"fmt"
)
4 years ago
func RunCron() error {
c := GetConfig()
var errs []error
for name, l := range c.Locations {
l.name = name
4 years ago
if err := l.RunCron(); err != nil {
errs = append(errs, err)
4 years ago
}
}
if len(errs) > 0 {
return fmt.Errorf("Encountered errors during cron process:\n%w", errors.Join(errs...))
}
4 years ago
return nil
}