From 36a59b61817567faa9b99d1cd8308aa07a4c9934 Mon Sep 17 00:00:00 2001 From: linxin Date: Wed, 12 Apr 2023 17:52:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A3=81=E7=9B=98=E7=A9=BA?= =?UTF-8?q?=E9=97=B4=E5=88=A4=E6=96=AD=E5=87=BD=E6=95=B0=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- corepipe/corepipe.go | 4 ++-- corepipe/corepipe_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/corepipe/corepipe.go b/corepipe/corepipe.go index 4fe2390..a27ca95 100644 --- a/corepipe/corepipe.go +++ b/corepipe/corepipe.go @@ -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 diff --git a/corepipe/corepipe_test.go b/corepipe/corepipe_test.go index 057bfec..755bd24 100644 --- a/corepipe/corepipe_test.go +++ b/corepipe/corepipe_test.go @@ -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