mirror of
https://github.com/restic/restic.git
synced 2026-08-13 00:53:17 +00:00
feat(backends/s3): add warmup support for check command (#5248)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user