优化系统goroutine使用,减少goroutine数量,增加goman查看goroutine数量指令

This commit is contained in:
刘祥超
2021-12-08 15:17:45 +08:00
parent 24fbd740b5
commit 1279f0d394
48 changed files with 469 additions and 146 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
"github.com/TeaOSLab/EdgeNode/internal/events"
"github.com/TeaOSLab/EdgeNode/internal/goman"
"github.com/TeaOSLab/EdgeNode/internal/remotelogs"
"github.com/TeaOSLab/EdgeNode/internal/utils"
"github.com/iwind/TeaGo/maps"
@@ -96,10 +97,10 @@ func (this *SystemServiceManager) setupSystemd(params maps.Map) error {
}
// 启动Service
go func() {
goman.New(func() {
time.Sleep(5 * time.Second)
_ = exec.Command(systemctl, "start", teaconst.SystemdServiceName).Start()
}()
})
if output == "enabled" {
// 检查文件路径是否变化