mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-27 22:31:32 +08:00
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user