mirror of
https://github.com/octoleo/restic.git
synced 2024-11-22 21:05:10 +00:00
Reenable Preloading
This commit is contained in:
parent
f214dce87c
commit
a0fea201d9
@ -18,7 +18,7 @@ import (
|
||||
const (
|
||||
maxConcurrentBlobs = 32
|
||||
maxConcurrency = 10
|
||||
maxConcurrencyPreload = 100
|
||||
maxConcurrencyPreload = 20
|
||||
|
||||
// chunkerBufSize is used in pool.go
|
||||
chunkerBufSize = 512 * chunker.KiB
|
||||
|
@ -193,11 +193,11 @@ func (cmd CmdBackup) Execute(args []string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// fmt.Printf("loading blobs\n")
|
||||
// err = arch.Preload()
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
fmt.Printf("loading blobs\n")
|
||||
err = arch.Preload()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, id, err := arch.Snapshot(target, parentSnapshotID)
|
||||
if err != nil {
|
||||
|
@ -109,14 +109,12 @@ func (s Server) LoadJSON(t backend.Type, blob Blob, item interface{}) error {
|
||||
}
|
||||
|
||||
var (
|
||||
zEmptyString = []byte("x\x9C\x03\x00\x00\x00\x00\x01")
|
||||
zEmptyStringReader = bytes.NewReader(zEmptyString)
|
||||
zEmptyString = []byte("x\x9C\x03\x00\x00\x00\x00\x01")
|
||||
)
|
||||
|
||||
var zReaderPool = sync.Pool{
|
||||
New: func() interface{} {
|
||||
zEmptyStringReader.Seek(0, 0)
|
||||
rd, err := zlib.NewReader(zEmptyStringReader)
|
||||
rd, err := zlib.NewReader(bytes.NewReader(zEmptyString))
|
||||
if err != nil {
|
||||
// shouldn't happen
|
||||
panic(err)
|
||||
|
Loading…
Reference in New Issue
Block a user