Skip to content

Commit 8b39a54

Browse files
committed
rename Multiplex into Reuse in the inner code
Signed-off-by: Li Yazhou <me.ssword@gmail.com>
1 parent 1ab08c3 commit 8b39a54

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

client/config/peerhost.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,8 @@ type StorageOption struct {
591591
// DiskGCThresholdPercent indicates the threshold to gc the oldest tasks according the disk usage
592592
// Eg, DiskGCThresholdPercent=80, when the disk usage is above 80%, start to gc the oldest tasks
593593
DiskGCThresholdPercent float64 `mapstructure:"diskGCThresholdPercent" yaml:"diskGCThresholdPercent"`
594-
// Multiplex indicates reusing underlying storage for same task id
595-
Multiplex bool `mapstructure:"multiplex" yaml:"multiplex"`
594+
// Reuse indicates reusing underlying storage for same task id
595+
Reuse bool `mapstructure:"multiplex" yaml:"multiplex"`
596596
StoreStrategy StoreStrategy `mapstructure:"strategy" yaml:"strategy"`
597597
// WriteBufferSize indicates the buffer size when read from source, same usage with io.Copy
598598
// for some resource plugins, bigger buffer size with better performance, on the other hand, bigger buffer size cost huge memory

client/daemon/daemon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ func New(opt *config.DaemonOption, d dfpath.Dfpath) (Daemon, error) {
269269
PerPeerRateLimit: opt.Download.PerPeerRateLimit.Limit,
270270
TotalRateLimit: opt.Download.TotalRateLimit.Limit,
271271
TrafficShaperType: opt.Download.TrafficShaperType,
272-
Multiplex: opt.Storage.Multiplex,
272+
Reuse: opt.Storage.Reuse,
273273
Prefetch: opt.Download.Prefetch,
274274
GetPiecesMaxRetry: opt.Download.GetPiecesMaxRetry,
275275
SplitRunningTasks: opt.Download.SplitRunningTasks,

client/daemon/peer/peertask_manager.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ type TaskManagerOption struct {
133133
PerPeerRateLimit rate.Limit
134134
TotalRateLimit rate.Limit
135135
TrafficShaperType string
136-
// Multiplex indicates to reuse the data of completed peer tasks
137-
Multiplex bool
136+
// Reuse indicates to reuse the data of completed peer tasks
137+
Reuse bool
138138
// Prefetch indicates to prefetch the whole files of ranged requests
139139
Prefetch bool
140140
GetPiecesMaxRetry int
@@ -329,7 +329,7 @@ func (ptm *peerTaskManager) StartFileTask(ctx context.Context, req *FileTaskRequ
329329
if req.KeepOriginalOffset && !ptm.Prefetch {
330330
return nil, fmt.Errorf("please enable prefetch when use original offset feature")
331331
}
332-
if ptm.Multiplex {
332+
if ptm.Reuse {
333333
progress, ok := ptm.tryReuseFilePeerTask(ctx, req)
334334
if ok {
335335
metrics.PeerTaskCacheHitCount.Add(1)
@@ -365,7 +365,7 @@ func (ptm *peerTaskManager) StartStreamTask(ctx context.Context, req *StreamTask
365365

366366
taskID := req.TaskID()
367367

368-
if ptm.Multiplex {
368+
if ptm.Reuse {
369369
// try breakpoint resume for task has range header
370370
if req.Range != nil && !ptm.SplitRunningTasks {
371371
// find running parent task

0 commit comments

Comments
 (0)