This commit is contained in:
孟帅
2023-11-25 18:36:11 +08:00
parent 40117c700d
commit 70e9f966c3
142 changed files with 5407 additions and 2058 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/gogf/gf/v2/errors/gerror"
"hotgo/api/servmsg"
"hotgo/internal/consts"
"hotgo/internal/library/cron"
)
// CronDelete 删除任务
@@ -95,3 +96,22 @@ func (s *sTCPServer) CronOnlineExec(ctx context.Context, in *servmsg.CronOnlineE
}
return
}
// DispatchLog 查看调度日志
func (s *sTCPServer) DispatchLog(ctx context.Context, in *servmsg.CronDispatchLogReq) (log *cron.Log, err error) {
clients := s.serv.GetGroupClients(consts.LicenseGroupCron)
if len(clients) == 0 {
err = gerror.New("没有在线的定时任务服务")
return
}
var res servmsg.CronDispatchLogRes
if err = s.serv.RequestScan(ctx, clients[0], in, &res); err != nil {
return
}
if err = res.GetError(); err != nil {
return
}
return res.Log, nil
}