diff --git a/cmd/restic/cmd_find.go b/cmd/restic/cmd_find.go index 378d6cbdc..45d42b45f 100644 --- a/cmd/restic/cmd_find.go +++ b/cmd/restic/cmd_find.go @@ -40,8 +40,6 @@ Exit status is 0 if the command was successful, and non-zero if there was any er }, } -const shortStr = 8 // Length of short IDs: 4 bytes as hex strings - // FindOptions bundles all options for the find command. type FindOptions struct { Oldest string @@ -386,12 +384,12 @@ func (f *Finder) findIDs(ctx context.Context, sn *restic.Snapshot) error { idStr := id.String() if _, ok := f.blobIDs[idStr]; !ok { // Look for short ID form - if _, ok := f.blobIDs[idStr[:shortStr]]; !ok { + if _, ok := f.blobIDs[id.Str()]; !ok { continue } // Replace the short ID with the long one f.blobIDs[idStr] = struct{}{} - delete(f.blobIDs, idStr[:shortStr]) + delete(f.blobIDs, id.Str()) } f.out.PrintObject("blob", idStr, nodepath, parentTreeID.String(), sn) } @@ -423,7 +421,7 @@ func (f *Finder) packsToBlobs(ctx context.Context, packs []string) error { idStr := id.String() if _, ok := packIDs[idStr]; !ok { // Look for short ID form - if _, ok := packIDs[idStr[:shortStr]]; !ok { + if _, ok := packIDs[id.Str()]; !ok { return nil } } diff --git a/internal/backend/azure/config.go b/internal/backend/azure/config.go index 66f0125e4..682356b01 100644 --- a/internal/backend/azure/config.go +++ b/internal/backend/azure/config.go @@ -16,7 +16,7 @@ type Config struct { Container string Prefix string - Connections uint `option:"connections" help:"set a limit for the number of concurrent connections (default: 20)"` + Connections uint `option:"connections" help:"set a limit for the number of concurrent connections (default: 5)"` } // NewConfig returns a new Config with the default values filled in. diff --git a/internal/backend/gs/config.go b/internal/backend/gs/config.go index 026ef3dfd..bd152d775 100644 --- a/internal/backend/gs/config.go +++ b/internal/backend/gs/config.go @@ -16,7 +16,7 @@ type Config struct { Bucket string Prefix string - Connections uint `option:"connections" help:"set a limit for the number of concurrent connections (default: 20)"` + Connections uint `option:"connections" help:"set a limit for the number of concurrent connections (default: 5)"` } // NewConfig returns a new Config with the default values filled in. diff --git a/internal/restic/readerat.go b/internal/restic/readerat.go index 6ed2e83f5..1a781c03f 100644 --- a/internal/restic/readerat.go +++ b/internal/restic/readerat.go @@ -35,10 +35,9 @@ func ReadAt(ctx context.Context, be Backend, h Handle, offset int64, p []byte) ( return ierr }) if err != nil { - return 0, err + return 0, errors.Wrapf(err, "ReadFull(%v)", h) } debug.Log("ReadAt(%v) ReadFull returned %v bytes", h, n) - - return n, errors.Wrapf(err, "ReadFull(%v)", h) + return n, nil }