mirror of
https://github.com/restic/restic.git
synced 2026-10-25 01:58:54 +00:00
Add chunker pool
This commit is contained in:
1 parent
3daeee8e2c
commit
bbb3145f11
2 files changed
+54
-11
No files matched your search
+6
-4
@@ -1,7 +1,6 @@
|
||||
package restic
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
@@ -18,7 +17,9 @@ import (
|
||||
const (
|
||||
maxConcurrentFiles = 16
|
||||
maxConcurrentBlobs = 16
|
||||
chunkerBufSize = 512 * chunker.KiB
|
||||
|
||||
// chunkerBufSize is used in pool.go
|
||||
chunkerBufSize = 512 * chunker.KiB
|
||||
)
|
||||
|
||||
type Archiver struct {
|
||||
@@ -161,9 +162,10 @@ func (arch *Archiver) SaveFile(node *Node) (Blobs, error) {
|
||||
var blobs Blobs
|
||||
|
||||
// store all chunks
|
||||
chnker := chunker.New(file, chunkerBufSize, sha256.New)
|
||||
chnker := GetChunker("archiver.SaveFile")
|
||||
chnker.Reset(file)
|
||||
chans := [](<-chan Blob){}
|
||||
//defer chnker.Free()
|
||||
defer FreeChunker("archiver.SaveFile", chnker)
|
||||
|
||||
chunks := 0
|
||||
|
||||
|
||||
Reference in new issue
Block a user