set up
This commit is contained in:
parent
7fd44a55cb
commit
bc79d54284
@ -18,6 +18,7 @@ const (
|
|||||||
STARTED
|
STARTED
|
||||||
FAILURE
|
FAILURE
|
||||||
SUCCESS
|
SUCCESS
|
||||||
|
FORGOTTEN
|
||||||
)
|
)
|
||||||
|
|
||||||
var str = [...]string{
|
var str = [...]string{
|
||||||
@ -25,6 +26,7 @@ var str = [...]string{
|
|||||||
"started",
|
"started",
|
||||||
"failure",
|
"failure",
|
||||||
"success",
|
"success",
|
||||||
|
"forgotten",
|
||||||
}
|
}
|
||||||
|
|
||||||
func FromInt(i int) string {
|
func FromInt(i int) string {
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package workflow_execution
|
package workflow_execution
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
"cloud.o-forge.io/core/oc-lib/dbs"
|
"cloud.o-forge.io/core/oc-lib/dbs"
|
||||||
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||||
"cloud.o-forge.io/core/oc-lib/models/utils"
|
"cloud.o-forge.io/core/oc-lib/models/utils"
|
||||||
@ -38,6 +40,10 @@ func (wfa *workflowExecutionMongoAccessor) LoadOne(id string) (utils.DBObject, i
|
|||||||
return nil, code, err
|
return nil, code, err
|
||||||
}
|
}
|
||||||
res_mongo.Decode(&workflow)
|
res_mongo.Decode(&workflow)
|
||||||
|
if workflow.State == int64(SCHEDULED) && time.Now().UTC().After(*workflow.ExecDate) {
|
||||||
|
workflow.State = int64(FORGOTTEN)
|
||||||
|
wfa.UpdateOne(&workflow, id)
|
||||||
|
}
|
||||||
return &workflow, 200, nil
|
return &workflow, 200, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user