修改磁盘空间判断函数名称
This commit is contained in:
@@ -20,7 +20,7 @@ import (
|
||||
|
||||
const chunkSize = 1024 * 1024 * 1024 // 1GB
|
||||
|
||||
func isMemorySufficient(pipe_config config.Pipeconfig) (bool, error) {
|
||||
func isDiskSufficient(pipe_config config.Pipeconfig) (bool, error) {
|
||||
percent, err := strconv.ParseFloat(pipe_config.Total_file_mem_limit[:len(pipe_config.Total_file_mem_limit)-1], 64)
|
||||
if err != nil {
|
||||
return false, err
|
||||
@@ -185,7 +185,7 @@ func main() {
|
||||
return
|
||||
}
|
||||
//判断硬盘使用率
|
||||
flag, err := isMemorySufficient(pipe_config)
|
||||
flag, err := isDiskSufficient(pipe_config)
|
||||
if err != nil && !flag {
|
||||
journal.Print(journal.PriErr, err.Error())
|
||||
return
|
||||
|
||||
@@ -53,7 +53,7 @@ func TestIsMemorySufficient(t *testing.T) {
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got, err := isMemorySufficient(tt.input.pipe_config)
|
||||
got, err := isDiskSufficient(tt.input.pipe_config)
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("isMemorySufficient() error = %v, wantErr %v", err, tt.wantErr)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user