修改磁盘空间判断函数名称

This commit is contained in:
linxin
2023-04-12 17:52:13 +08:00
parent b4aa808083
commit 36a59b6181
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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