From 89f14d99b81c185dd23b3108333e48c58e330ac8 Mon Sep 17 00:00:00 2001 From: mr Date: Fri, 2 Aug 2024 16:09:17 +0200 Subject: [PATCH] mongo and or --- models/workflow/workflow_mongo_accessor.go | 4 ++-- models/workflow_execution/workflow_execution.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/models/workflow/workflow_mongo_accessor.go b/models/workflow/workflow_mongo_accessor.go index 6ff1e11..500cfb8 100644 --- a/models/workflow/workflow_mongo_accessor.go +++ b/models/workflow/workflow_mongo_accessor.go @@ -51,7 +51,7 @@ func (wfa *workflowMongoAccessor) execution(realData *Workflow, delete bool) (in obj := &workflow_execution.WorkflowExecution{ ExecDate: &s, EndDate: realData.Schedule.End, - State: 0, + State: 1, WorkflowID: realData.UUID, } accessor.StoreOne(obj) @@ -61,7 +61,7 @@ func (wfa *workflowMongoAccessor) execution(realData *Workflow, delete bool) (in obj := &workflow_execution.WorkflowExecution{ ExecDate: realData.Schedule.Start, EndDate: realData.Schedule.End, - State: 0, + State: 1, WorkflowID: realData.UUID, } accessor.StoreOne(obj) diff --git a/models/workflow_execution/workflow_execution.go b/models/workflow_execution/workflow_execution.go index a813e06..c33dce3 100644 --- a/models/workflow_execution/workflow_execution.go +++ b/models/workflow_execution/workflow_execution.go @@ -11,7 +11,7 @@ import ( type ScheduledType int const ( - SCHEDULED ScheduledType = iota + SCHEDULED ScheduledType = iota + 1 STARTED FAILURE SUCCESS @@ -41,7 +41,7 @@ type WorkflowExecution struct { UUID string `json:"id,omitempty" bson:"id,omitempty" validate:"required"` ExecDate *time.Time `json:"execution_date,omitempty" bson:"execution_date,omitempty" validate:"required"` EndDate *time.Time `json:"end_date,omitempty" bson:"end_date,omitempty"` - State int `json:"state,omitempty" bson:"state,omitempty" ` + State int64 `json:"state,omitempty" bson:"state,omitempty"` WorkflowID string `json:"workflow_id" bson:"workflow_id,omitempty"` }