Skip to content

Commit

Permalink
chore: enable calculate digest (#656)
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Ma <majinjing3@gmail.com>
  • Loading branch information
jim3ma committed Sep 17, 2021
1 parent 19d1495 commit f6b3927
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion client/config/peerhost_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (
"net"
"time"

"d7y.io/dragonfly/v2/pkg/basic/dfnet"
"golang.org/x/time/rate"

"d7y.io/dragonfly/v2/client/clientutil"
"d7y.io/dragonfly/v2/pkg/basic"
"d7y.io/dragonfly/v2/pkg/basic/dfnet"
"d7y.io/dragonfly/v2/pkg/util/net/iputils"
)

Expand Down Expand Up @@ -61,6 +61,7 @@ var peerHostConfig = DaemonOption{
NetTopology: "",
},
Download: DownloadOption{
CalculateDigest: true,
PieceDownloadTimeout: 30 * time.Second,
TotalRateLimit: clientutil.RateLimit{
Limit: rate.Limit(DefaultTotalDownloadLimit),
Expand Down
3 changes: 2 additions & 1 deletion client/config/peerhost_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (
"net"
"time"

"d7y.io/dragonfly/v2/pkg/basic/dfnet"
"golang.org/x/time/rate"

"d7y.io/dragonfly/v2/client/clientutil"
"d7y.io/dragonfly/v2/pkg/basic"
"d7y.io/dragonfly/v2/pkg/basic/dfnet"
"d7y.io/dragonfly/v2/pkg/util/net/iputils"
)

Expand Down Expand Up @@ -61,6 +61,7 @@ var peerHostConfig = DaemonOption{
NetTopology: "",
},
Download: DownloadOption{
CalculateDigest: true,
PieceDownloadTimeout: 30 * time.Second,
TotalRateLimit: clientutil.RateLimit{
Limit: rate.Limit(DefaultTotalDownloadLimit),
Expand Down
2 changes: 2 additions & 0 deletions docs/en/config/dfget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ host:

# download service option
download:
# calculate digest when transfer files, set false to save memory
calculateDigest: true
# total download limit per second
totalRateLimit: 200Mi
# per peer task download limit per second
Expand Down
2 changes: 2 additions & 0 deletions docs/zh-CN/config/dfget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ host:

# 下载服务选项
download:
# 是否计算文件摘要,设置为 false 的话,会节省内存
calculateDigest: true
# 总下载限速
totalRateLimit: 200Mi
# 单个任务下载限速
Expand Down

0 comments on commit f6b3927

Please sign in to comment.