diff --git a/models/workflow/workflow_mongo_accessor.go b/models/workflow/workflow_mongo_accessor.go index f8d2f50..7f0f192 100644 --- a/models/workflow/workflow_mongo_accessor.go +++ b/models/workflow/workflow_mongo_accessor.go @@ -22,7 +22,7 @@ func New() *workflowMongoAccessor { return &workflowMongoAccessor{} } -func (wfa *workflowMongoAccessor) checkBooking(data *Workflow) bool { +func (wfa *workflowMongoAccessor) CheckBooking(data *Workflow) bool { accessor := (&workflow_execution.WorkflowExecution{}).GetAccessor() s := data.Schedule.Start.Add(time.Duration(-10) * time.Second) e := data.Schedule.Start.Add(time.Duration(10) * time.Second) @@ -96,7 +96,7 @@ func (wfa *workflowMongoAccessor) execution(id string, realData *Workflow, delet if r.Schedule.Start == realData.Schedule.Start && r.Schedule.End == realData.Schedule.End && r.Schedule.Cron == realData.Schedule.Cron { return 200, nil } - if !wfa.checkBooking(realData) { + if !wfa.CheckBooking(realData) { return 409, errors.New("the booking is already taken.") } if delete {