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"
 | 
						"github.com/TeaOSLab/EdgeNode/internal/remotelogs"
 | 
				
			||||||
	executils "github.com/TeaOSLab/EdgeNode/internal/utils/exec"
 | 
						executils "github.com/TeaOSLab/EdgeNode/internal/utils/exec"
 | 
				
			||||||
	"github.com/shirou/gopsutil/v3/load"
 | 
						"github.com/shirou/gopsutil/v3/load"
 | 
				
			||||||
 | 
						"runtime"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -50,6 +51,10 @@ func (this *TrimDisksTask) Start() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// run the task once
 | 
					// run the task once
 | 
				
			||||||
func (this *TrimDisksTask) loop() error {
 | 
					func (this *TrimDisksTask) loop() error {
 | 
				
			||||||
 | 
						if runtime.GOOS != "linux" {
 | 
				
			||||||
 | 
							return nil
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	var nodeConfig = sharedNodeConfig
 | 
						var nodeConfig = sharedNodeConfig
 | 
				
			||||||
	if nodeConfig == nil {
 | 
						if nodeConfig == nil {
 | 
				
			||||||
		return nil
 | 
							return nil
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user