mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 10:59:32 +08:00
fix: Use localStorage path to check disk cap (#30944)
See also #30943 --------- Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
a5a4ca8459
commit
36d78e3dd0
@ -2267,9 +2267,15 @@ Max read concurrency must greater than or equal to 1, and less than or equal to
|
||||
Version: "2.2.0",
|
||||
Formatter: func(v string) string {
|
||||
if len(v) == 0 {
|
||||
diskUsage, err := disk.Usage("/")
|
||||
// use local storage path to check correct device
|
||||
localStoragePath := base.Get("localStorage.path")
|
||||
if _, err := os.Stat(localStoragePath); os.IsNotExist(err) {
|
||||
os.MkdirAll(localStoragePath, os.ModePerm)
|
||||
}
|
||||
diskUsage, err := disk.Usage(localStoragePath)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
// panic(err)
|
||||
log.Fatal("failed to get disk usage", zap.String("localStoragePath", localStoragePath), zap.Error(err))
|
||||
}
|
||||
return strconv.FormatUint(diskUsage.Total, 10)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user