fix: different cronexpr rules between ui and pocketbase

This commit is contained in:
Fu Diwei
2025-02-10 09:59:03 +08:00
parent a74ec95a6a
commit b8513eb0b6
10 changed files with 35 additions and 21 deletions

View File

@@ -48,6 +48,8 @@ func (s *WorkflowService) InitSchedule(ctx context.Context) error {
scheduler := app.GetScheduler()
for _, workflow := range workflows {
var errs []error
err := scheduler.Add(fmt.Sprintf("workflow#%s", workflow.Id), workflow.TriggerCron, func() {
s.StartRun(ctx, &dtos.WorkflowStartRunReq{
WorkflowId: workflow.Id,
@@ -55,7 +57,11 @@ func (s *WorkflowService) InitSchedule(ctx context.Context) error {
})
})
if err != nil {
return err
errs = append(errs, err)
}
if len(errs) > 0 {
return errors.Join(errs...)
}
}