mirror of
https://github.com/usual2970/certimate.git
synced 2025-07-27 02:08:34 +00:00
feat: rename , executionMethod
/type
to trigger
, crontab
to triggerCron
This commit is contained in:
@@ -46,16 +46,16 @@ func update(ctx context.Context, record *models.Record) error {
|
||||
|
||||
id := record.Id
|
||||
enabled := record.GetBool("enabled")
|
||||
executeMethod := record.GetString("type")
|
||||
trigger := record.GetString("trigger")
|
||||
|
||||
scheduler := app.GetScheduler()
|
||||
if !enabled || executeMethod == domain.WorkflowTypeManual {
|
||||
if !enabled || trigger == domain.WorkflowTriggerManual {
|
||||
scheduler.Remove(id)
|
||||
scheduler.Start()
|
||||
return nil
|
||||
}
|
||||
|
||||
err := scheduler.Add(id, record.GetString("crontab"), func() {
|
||||
err := scheduler.Add(id, record.GetString("triggerCron"), func() {
|
||||
NewWorkflowService(repository.NewWorkflowRepository()).Run(ctx, &domain.WorkflowRunReq{
|
||||
Id: id,
|
||||
})
|
||||
|
@@ -33,7 +33,7 @@ func (s *WorkflowService) InitSchedule(ctx context.Context) error {
|
||||
}
|
||||
scheduler := app.GetScheduler()
|
||||
for _, workflow := range workflows {
|
||||
err := scheduler.Add(workflow.Id, workflow.Crontab, func() {
|
||||
err := scheduler.Add(workflow.Id, workflow.TriggerCron, func() {
|
||||
s.Run(ctx, &domain.WorkflowRunReq{
|
||||
Id: workflow.Id,
|
||||
})
|
||||
|
Reference in New Issue
Block a user