diff --git a/models/booking/booking_mongo_accessor.go b/models/booking/booking_mongo_accessor.go index 18ab5f7..1713264 100644 --- a/models/booking/booking_mongo_accessor.go +++ b/models/booking/booking_mongo_accessor.go @@ -52,7 +52,7 @@ func (a *bookingMongoAccessor) CopyOne(data utils.DBObject) (utils.DBObject, int func (a *bookingMongoAccessor) LoadOne(id string) (utils.DBObject, int, error) { return utils.GenericLoadOne[*Booking](id, func(d utils.DBObject) (utils.DBObject, int, error) { now := time.Now() - now = now.Add(time.Second * 60) + now = now.Add(time.Second * -60) if d.(*Booking).State == enum.DRAFT && now.UTC().After(d.(*Booking).ExpectedStartDate) { return utils.GenericDeleteOne(d.GetID(), a) } @@ -78,7 +78,7 @@ func (a *bookingMongoAccessor) Search(filters *dbs.Filters, search string, isDra func (a *bookingMongoAccessor) getExec() func(utils.DBObject) utils.ShallowDBObject { return func(d utils.DBObject) utils.ShallowDBObject { now := time.Now() - now = now.Add(time.Second * 60) + now = now.Add(time.Second * -60) if d.(*Booking).State == enum.DRAFT && now.UTC().After(d.(*Booking).ExpectedStartDate) { utils.GenericDeleteOne(d.GetID(), a) return nil diff --git a/models/peer/peer_cache.go b/models/peer/peer_cache.go index b512340..e7500e4 100644 --- a/models/peer/peer_cache.go +++ b/models/peer/peer_cache.go @@ -48,7 +48,7 @@ func (p *PeerCache) urlFormat(url string, dt tools.DataType) string { url = strings.ReplaceAll(url, localhost, dt.API()+":8080/oc") } } else { - url = url + "/" + dt.API() + url = url + "/" + strings.ReplaceAll(dt.API(), "oc-", "") } return url } diff --git a/models/workflow_execution/workflow_execution_mongo_accessor.go b/models/workflow_execution/workflow_execution_mongo_accessor.go index 9bd6ec8..9b38913 100644 --- a/models/workflow_execution/workflow_execution_mongo_accessor.go +++ b/models/workflow_execution/workflow_execution_mongo_accessor.go @@ -61,7 +61,7 @@ func (wfa *workflowExecutionMongoAccessor) CopyOne(data utils.DBObject) (utils.D func (a *workflowExecutionMongoAccessor) LoadOne(id string) (utils.DBObject, int, error) { return utils.GenericLoadOne[*WorkflowExecution](id, func(d utils.DBObject) (utils.DBObject, int, error) { now := time.Now() - now = now.Add(time.Second * 60) + now = now.Add(time.Second * -60) if d.(*WorkflowExecution).State == enum.DRAFT && !a.shallow && now.UTC().After(d.(*WorkflowExecution).ExecDate) { utils.GenericDeleteOne(d.GetID(), newShallowAccessor(a.Request)) return nil, 404, errors.New("not found") @@ -85,7 +85,7 @@ func (a *workflowExecutionMongoAccessor) Search(filters *dbs.Filters, search str func (a *workflowExecutionMongoAccessor) getExec() func(utils.DBObject) utils.ShallowDBObject { return func(d utils.DBObject) utils.ShallowDBObject { now := time.Now() - now = now.Add(time.Second * 60) + now = now.Add(time.Second * -60) if d.(*WorkflowExecution).State == enum.DRAFT && now.UTC().After(d.(*WorkflowExecution).ExecDate) { utils.GenericDeleteOne(d.GetID(), newShallowAccessor(a.Request)) return nil