light modification
This commit is contained in:
parent
386881c283
commit
d15fdac27b
@ -2,6 +2,7 @@ package workflow_execution
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"cloud.o-forge.io/core/oc-lib/dbs"
|
"cloud.o-forge.io/core/oc-lib/dbs"
|
||||||
@ -78,13 +79,14 @@ func (a *workflowExecutionMongoAccessor) Search(filters *dbs.Filters, search str
|
|||||||
|
|
||||||
func (a *workflowExecutionMongoAccessor) getExec() func(utils.DBObject) utils.ShallowDBObject {
|
func (a *workflowExecutionMongoAccessor) getExec() func(utils.DBObject) utils.ShallowDBObject {
|
||||||
return func(d utils.DBObject) utils.ShallowDBObject {
|
return func(d utils.DBObject) utils.ShallowDBObject {
|
||||||
|
fmt.Println("getExec", d)
|
||||||
if d.(*WorkflowExecutions).State == enum.DRAFT && time.Now().UTC().After(d.(*WorkflowExecutions).ExecDate) {
|
if d.(*WorkflowExecutions).State == enum.DRAFT && time.Now().UTC().After(d.(*WorkflowExecutions).ExecDate) {
|
||||||
utils.GenericDeleteOne(d.GetID(), newShallowAccessor(a.Request))
|
utils.GenericDeleteOne(d.GetID(), newShallowAccessor(a.Request))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if d.(*WorkflowExecutions).State == enum.SCHEDULED && time.Now().UTC().After(d.(*WorkflowExecutions).ExecDate) {
|
if d.(*WorkflowExecutions).State == enum.SCHEDULED && time.Now().UTC().After(d.(*WorkflowExecutions).ExecDate) {
|
||||||
d.(*WorkflowExecutions).State = enum.FORGOTTEN
|
d.(*WorkflowExecutions).State = enum.FORGOTTEN
|
||||||
d, _, _ = utils.GenericRawUpdateOne(d, d.GetID(), newShallowAccessor(a.Request))
|
utils.GenericRawUpdateOne(d, d.GetID(), newShallowAccessor(a.Request))
|
||||||
return d
|
return d
|
||||||
}
|
}
|
||||||
return d
|
return d
|
||||||
|
Loading…
Reference in New Issue
Block a user