优化代码/增加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

@@ -4,6 +4,7 @@ import (
teaconst "github.com/TeaOSLab/EdgeAPI/internal/const"
"github.com/TeaOSLab/EdgeAPI/internal/db/models/stats"
"github.com/TeaOSLab/EdgeAPI/internal/errors"
"github.com/TeaOSLab/EdgeAPI/internal/goman"
"github.com/TeaOSLab/EdgeAPI/internal/remotelogs"
"github.com/iwind/TeaGo/Tea"
"github.com/iwind/TeaGo/dbs"
@@ -40,7 +41,7 @@ func init() {
dbs.OnReadyDone(func() {
// 导入统计数据
go func() {
goman.New(func() {
var duration = 30 * time.Minute
if Tea.IsTesting() {
// 测试条件下缩短时间,以便进行观察
@@ -53,7 +54,7 @@ func init() {
remotelogs.Error("SERVER_SERVICE", err.Error())
}
}
}()
})
})
}