mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 20:07:23 +08:00
refactoring: simplify function parameter
This commit is contained in:
@@ -63,14 +63,7 @@ func (l *DiskLocation) loadExistingVolume(dir os.FileInfo, needleMapKind NeedleM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *DiskLocation) concurrentLoadingVolumes(needleMapKind NeedleMapType, concurrentFlag bool) {
|
func (l *DiskLocation) concurrentLoadingVolumes(needleMapKind NeedleMapType, concurrency int) {
|
||||||
var concurrency int
|
|
||||||
if concurrentFlag {
|
|
||||||
//You could choose a better optimized concurency value after testing at your environment
|
|
||||||
concurrency = 10
|
|
||||||
} else {
|
|
||||||
concurrency = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
task_queue := make(chan os.FileInfo, 10*concurrency)
|
task_queue := make(chan os.FileInfo, 10*concurrency)
|
||||||
go func() {
|
go func() {
|
||||||
@@ -101,7 +94,7 @@ func (l *DiskLocation) loadExistingVolumes(needleMapKind NeedleMapType) {
|
|||||||
l.Lock()
|
l.Lock()
|
||||||
defer l.Unlock()
|
defer l.Unlock()
|
||||||
|
|
||||||
l.concurrentLoadingVolumes(needleMapKind, true)
|
l.concurrentLoadingVolumes(needleMapKind, 10)
|
||||||
|
|
||||||
glog.V(0).Infoln("Store started on dir:", l.Directory, "with", len(l.volumes), "volumes", "max", l.MaxVolumeCount)
|
glog.V(0).Infoln("Store started on dir:", l.Directory, "with", len(l.volumes), "volumes", "max", l.MaxVolumeCount)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user