Skip to content

Commit

Permalink
join errors
Browse files Browse the repository at this point in the history
  • Loading branch information
korotkov-aerospike committed Dec 23, 2024
1 parent b412d83 commit dc59991
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/service/retention_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package service

import (
"context"
"errors"
"fmt"
"slices"
"time"
Expand Down Expand Up @@ -95,14 +96,15 @@ func (e *RetentionManagerImpl) deleteIncrementalBackups(
return fmt.Errorf("failed to fetch incremental backups: %w", err)
}

var errs error
for _, b := range incrBackups {
path := getTimestampPath(e.routineName, b.Created, jobTypeIncremental)
if err := storage.DeleteFolder(ctx, e.storage, path); err != nil {
return fmt.Errorf("failed to delete folder at %v: %w", path, err)
errs = errors.Join(errs, fmt.Errorf("failed to delete folder at %v: %w", path, err))
}
}

return nil
return errs
}

func getTimestamps(backups []model.BackupDetails) []time.Time {
Expand Down

0 comments on commit dc59991

Please sign in to comment.