test neo oclib
This commit is contained in:
10
main.go
10
main.go
@@ -112,13 +112,12 @@ func main() {
|
||||
|
||||
// Return the Workflow ID associated to a workflow execution object
|
||||
func getWorkflowId(exec_id string) string {
|
||||
res := oclib.LoadOne(oclib.LibDataEnum(oclib.WORKFLOW_EXECUTION), exec_id)
|
||||
res := oclib.NewRequest(oclib.LibDataEnum(oclib.WORKFLOW_EXECUTION), "", "", []string{}, nil).LoadOne(exec_id)
|
||||
if res.Code != 200 {
|
||||
logger.Error().Msg("Could not retrieve workflow ID from execution ID " + exec_id)
|
||||
return ""
|
||||
}
|
||||
wf_exec := res.ToWorkflowExecution()
|
||||
|
||||
return wf_exec.WorkflowID
|
||||
}
|
||||
|
||||
@@ -292,12 +291,11 @@ func checkStatus(current *models.ArgoWatch, previous *models.ArgoWatch) {
|
||||
func updateStatus(status string) {
|
||||
exec_id := conf.GetConfig().ExecutionID
|
||||
|
||||
wf_exec := &workflow_execution.WorkflowExecution{AbstractObject: utils.AbstractObject{UUID: conf.GetConfig().ExecutionID}}
|
||||
wf_exec := &workflow_execution.WorkflowExecutions{AbstractObject: utils.AbstractObject{UUID: conf.GetConfig().ExecutionID}}
|
||||
wf_exec.ArgoStatusToState(status)
|
||||
|
||||
serialized := wf_exec.Serialize()
|
||||
|
||||
res := oclib.UpdateOne(oclib.LibDataEnum(oclib.WORKFLOW_EXECUTION), serialized, exec_id)
|
||||
res := oclib.NewRequest(oclib.LibDataEnum(oclib.WORKFLOW_EXECUTION), "", "", []string{}, nil).UpdateOne(
|
||||
wf_exec.Serialize(wf_exec), exec_id)
|
||||
|
||||
if res.Code != 200 {
|
||||
logger.Error().Msg("Could not update status for workflow execution " + exec_id)
|
||||
|
||||
Reference in New Issue
Block a user