set up
This commit is contained in:
parent
7fd44a55cb
commit
bc79d54284
@ -18,6 +18,7 @@ const (
|
||||
STARTED
|
||||
FAILURE
|
||||
SUCCESS
|
||||
FORGOTTEN
|
||||
)
|
||||
|
||||
var str = [...]string{
|
||||
@ -25,6 +26,7 @@ var str = [...]string{
|
||||
"started",
|
||||
"failure",
|
||||
"success",
|
||||
"forgotten",
|
||||
}
|
||||
|
||||
func FromInt(i int) string {
|
||||
|
@ -1,6 +1,8 @@
|
||||
package workflow_execution
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"cloud.o-forge.io/core/oc-lib/dbs"
|
||||
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||
"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
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user