This commit is contained in:
孟帅
2023-03-13 17:00:46 +08:00
parent ab912d0ba6
commit 1acc6d17c4
51 changed files with 2777 additions and 1024 deletions

View File

@@ -16,6 +16,7 @@ import (
"hotgo/internal/consts"
"hotgo/internal/dao"
"hotgo/internal/model/entity"
"hotgo/utility/simple"
"strings"
"sync"
)
@@ -161,7 +162,9 @@ func Stop(sysCron *entity.SysCron) (err error) {
func Once(ctx context.Context, sysCron *entity.SysCron) error {
for _, v := range cronList {
if v.GetName() == sysCron.Name {
go v.Execute(ctx)
simple.SafeGo(ctx, func(ctx context.Context) {
v.Execute(ctx)
})
return nil
}
}