mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 07:40:56 +08:00 
			
		
		
		
	限制硬盘TRIM只在Linux下执行
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user