better load & peear cache for traefik
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user