优化代码/增加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 (
"encoding/json"
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeAPI/internal/errors"
"github.com/TeaOSLab/EdgeAPI/internal/goman"
"github.com/TeaOSLab/EdgeCommon/pkg/systemconfigs"
"github.com/iwind/TeaGo/dbs"
"github.com/iwind/TeaGo/logs"
@@ -14,13 +15,15 @@ import (
)
func init() {
dbs.OnReady(func() {
dbs.OnReadyDone(func() {
task := NewServerAccessLogCleaner()
go task.Start()
goman.New(func() {
task.Start()
})
})
}
// 服务访问日志自动清理
// ServerAccessLogCleaner 服务访问日志自动清理
type ServerAccessLogCleaner struct {
}