1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-09 17:45:03 +09:00

Merge pull request #58 from anytypeio/fix-increase-ipfs-chunk-size

increase ipfs chunk size
This commit is contained in:
Sergey Cherepanov 2023-03-21 20:35:39 +03:00 committed by GitHub
commit d20f5fc2b3
Signed by: github
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,6 +22,10 @@ const CName = "common.commonfile.fileservice"
var log = logger.NewNamed(CName)
const (
ChunkSize = 1 << 20
)
func New() FileService {
return &fileService{}
}
@ -74,7 +78,7 @@ func (fs *fileService) AddFile(ctx context.Context, r io.Reader) (ipld.Node, err
Maxlinks: helpers.DefaultLinksPerBlock,
CidBuilder: &fs.prefix,
}
dbh, err := dbp.New(chunker.DefaultSplitter(r))
dbh, err := dbp.New(chunker.NewSizeSplitter(r, ChunkSize))
if err != nil {
return nil, err
}