feat(backends/s3): add warmup support for check command (#5248)

This commit is contained in:
Gilbert Gilb's
2026-06-25 20:46:55 +02:00
committed by GitHub
parent 4e8eea7ab4
commit db03aed816
9 changed files with 76 additions and 16 deletions
+3 -3
View File
@@ -292,10 +292,10 @@ func (c *Checker) UnusedBlobs(ctx context.Context) (blobs restic.BlobHandles, er
// with an unmodified parameter list
// Otherwise it calculates the packfiles needed, gets their sizes from the full
// packfile set and submits them to repository.ReadPacks()
func (c *Checker) ReadPacks(ctx context.Context, filter func(packs map[restic.ID]int64) map[restic.ID]int64, p restic.Counter, errChan chan<- error) {
func (c *Checker) ReadPacks(ctx context.Context, filter func(packs map[restic.ID]int64) map[restic.ID]int64, printer restic.Printer, errChan chan<- error) {
// no snapshot filtering, pass through
if !c.IsFiltered() {
c.Checker.ReadPacks(ctx, filter, p, errChan)
c.Checker.ReadPacks(ctx, filter, printer, errChan)
return
}
@@ -314,5 +314,5 @@ func (c *Checker) ReadPacks(ctx context.Context, filter func(packs map[restic.ID
return filter(filteredPacks)
}
c.Checker.ReadPacks(ctx, packfileFilter, p, errChan)
c.Checker.ReadPacks(ctx, packfileFilter, printer, errChan)
}
+1 -1
View File
@@ -58,7 +58,7 @@ func checkData(chkr *checker.Checker) []error {
func(ctx context.Context, errCh chan<- error) {
chkr.ReadPacks(ctx, func(packs map[restic.ID]int64) map[restic.ID]int64 {
return packs
}, restic.NoopCounter, errCh)
}, restic.NewNoopPrinter(), errCh)
},
)
}
+1 -1
View File
@@ -55,7 +55,7 @@ func TestCheckRepo(t testing.TB, repo checkerRepository) {
errChan = make(chan error)
go chkr.ReadPacks(context.TODO(), func(packs map[restic.ID]int64) map[restic.ID]int64 {
return packs
}, restic.NoopCounter, errChan)
}, restic.NewNoopPrinter(), errChan)
for err := range errChan {
t.Error(err)