mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-20 21:14:25 +02:00
avoid nil
This commit is contained in:
1 parent
cb9cc29518
commit
38bbef7ec1
1 file changed
+4
-1
@@ -205,7 +205,10 @@ type CapacityFunc func(*master_pb.DataNodeInfo) int
|
||||
|
||||
func capacityByMaxVolumeCount(diskType types.DiskType) CapacityFunc {
|
||||
return func(info *master_pb.DataNodeInfo) int {
|
||||
diskInfo := info.DiskInfos[string(diskType)]
|
||||
diskInfo, found := info.DiskInfos[string(diskType)]
|
||||
if !found {
|
||||
return 0
|
||||
}
|
||||
return int(diskInfo.MaxVolumeCount)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user