Bug on Format date

This commit is contained in:
mr 2024-08-21 17:19:22 +02:00
parent 99bf1106f3
commit b8b62dc2c8

View File

@ -138,6 +138,10 @@ func (wfa *workflowMongoAccessor) book(id string, realData *Workflow, execs []*w
}
func (wfa *workflowMongoAccessor) execution(id string, realData *Workflow, delete bool) (int, error) {
if realData.Schedule == nil {
realData.ScheduleActive = false
return 200, nil
}
var err error
nats := tools.NewNATSCaller()
res, code, _ := wfa.LoadOne(id)
@ -154,10 +158,14 @@ func (wfa *workflowMongoAccessor) execution(id string, realData *Workflow, delet
nats.SetNATSPub(utils.WORKFLOW.String(), tools.REMOVE, realData)
return 200, err
}
if r.Schedule != nil && r.Schedule.Start == realData.Schedule.Start && r.Schedule.End == realData.Schedule.End && r.Schedule.Cron == realData.Schedule.Cron {
if r.Schedule != nil {
if r.Schedule.Start != nil && realData.Schedule.Start != nil && (r.Schedule.Start.Equal(*realData.Schedule.Start) || r.Schedule.Start.After(*realData.Schedule.Start)) {
return 200, nil
}
if r.Schedule.Start == realData.Schedule.Start && r.Schedule.End == realData.Schedule.End && r.Schedule.Cron == realData.Schedule.Cron {
return 200, nil
}
}
accessor := (&workflow_execution.WorkflowExecution{}).GetAccessor(nil)
execs, err := wfa.getExecutions(id, realData)
if err != nil {