限制硬盘TRIM只在Linux下执行

This commit is contained in:
GoEdgeLab
2024-04-05 11:47:54 +08:00
parent 2213934795
commit 6fc0067fed

View File

@@ -7,6 +7,7 @@ import (
"github.com/TeaOSLab/EdgeNode/internal/remotelogs"
executils "github.com/TeaOSLab/EdgeNode/internal/utils/exec"
"github.com/shirou/gopsutil/v3/load"
"runtime"
"time"
)
@@ -50,6 +51,10 @@ func (this *TrimDisksTask) Start() {
// run the task once
func (this *TrimDisksTask) loop() error {
if runtime.GOOS != "linux" {
return nil
}
var nodeConfig = sharedNodeConfig
if nodeConfig == nil {
return nil