优化代码/增加edge-api goman命令

This commit is contained in:
GoEdgeLab
2021-12-14 10:49:29 +08:00
parent 0646d474a9
commit 515ead530d
54 changed files with 383 additions and 131 deletions

View File

@@ -7,6 +7,7 @@ import (
teaconst "github.com/TeaOSLab/EdgeAPI/internal/const"
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeAPI/internal/errors"
"github.com/TeaOSLab/EdgeAPI/internal/goman"
"github.com/TeaOSLab/EdgeAPI/internal/remotelogs"
"github.com/TeaOSLab/EdgeAPI/internal/utils"
"github.com/TeaOSLab/EdgeCommon/pkg/configutils"
@@ -116,7 +117,7 @@ func (this *HealthCheckExecutor) Run() ([]*HealthCheckResult, error) {
wg := sync.WaitGroup{}
wg.Add(countResults)
for i := 0; i < countRoutines; i++ {
go func() {
goman.New(func() {
for {
select {
case result := <-queue:
@@ -177,7 +178,7 @@ func (this *HealthCheckExecutor) Run() ([]*HealthCheckResult, error) {
return
}
}
}()
})
}
wg.Wait()