1
0
mirror of https://github.com/offen/docker-volume-backup.git synced 2025-06-20 06:25:36 +02:00

Handle configuration errors for Azure storage upfront

This commit is contained in:
Frederik Ring
2024-08-11 15:08:06 +02:00
parent 8a64da4b0b
commit d8aa6db3f5
4 changed files with 115 additions and 92 deletions

View File

@ -36,6 +36,9 @@ func (c *command) runAsCommand() error {
}
for _, config := range configurations {
if err := config.validate(); err != nil {
return errwrap.Wrap(err, "error validating config")
}
if err := runScript(config); err != nil {
return errwrap.Wrap(err, "error running script")
}
@ -101,6 +104,12 @@ func (c *command) schedule(strategy configStrategy) error {
}
for _, cfg := range configurations {
if err := cfg.validate(); err != nil {
return errwrap.Wrap(
err,
fmt.Sprintf("error validating config for schedule %s", cfg.BackupCronExpression),
)
}
config := cfg
id, err := c.cr.AddFunc(config.BackupCronExpression, func() {
c.logger.Info(