Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
Signed-off-by: Yee Hing Tong <[email protected]>
  • Loading branch information
wild-endeavor committed Nov 13, 2023
1 parent 568127e commit 18d6809
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 0 additions & 6 deletions flyteadmin/pkg/manager/impl/task_execution_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,13 @@ func (m *TaskExecutionManager) updateTaskExecutionModelState(
func (m *TaskExecutionManager) CreateTaskExecutionEvent(ctx context.Context, request admin.TaskExecutionEventRequest) (
*admin.TaskExecutionEventResponse, error) {

logger.Warningf(ctx, "HERE!!!123")

if err := validation.ValidateTaskExecutionRequest(request, m.config.ApplicationConfiguration().GetRemoteDataConfig().MaxSizeInBytes); err != nil {
return nil, err
}
logger.Warningf(ctx, "HERE!!!123-1")

if err := validation.ValidateClusterForExecutionID(ctx, m.db, request.Event.ParentNodeExecutionId.ExecutionId, request.Event.ProducerId); err != nil {
return nil, err
}
logger.Warningf(ctx, "HERE!!!123-2")

// Get the parent node execution, if none found a MissingEntityError will be returned
nodeExecutionID := request.Event.ParentNodeExecutionId
Expand Down Expand Up @@ -209,10 +205,8 @@ func (m *TaskExecutionManager) CreateTaskExecutionEvent(ctx context.Context, req
logger.Infof(ctx, "error publishing event [%+v] with err: [%v]", request.RequestId, err)
}

logger.Warningf(ctx, "HERE!!!123-3")
go func() {
ceCtx := context.Background()
logger.Warningf(ctx, "HERE!!!123-4")
if err := m.cloudEventsPublisher.Publish(ceCtx, proto.MessageName(&request), &request); err != nil {
logger.Errorf(ctx, "error publishing cloud event [%+v] with err: [%v]", request.RequestId, err)
}
Expand Down
9 changes: 8 additions & 1 deletion flyteartifacts/pkg/db/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,14 @@ func (r *RDSStorage) GetTriggersByArtifactKey(ctx context.Context, key core.Arti

ts := make([]Trigger, len(triggerKey))

db = r.db.Preload("RunsOn").Model(&Trigger{}).InnerJoins("TriggerKey", r.db.Where(&triggerKey)).Where("active = true").Find(&ts)
var triggerCondition = r.db.Where(&triggerKey[0])
if len(triggerKey) > 1 {
for _, tk := range triggerKey[1:] {
triggerCondition = triggerCondition.Or(&tk)
}
}

db = r.db.Preload("RunsOn").Model(&Trigger{}).InnerJoins("TriggerKey", triggerCondition).Where("active = true").Find(&ts)
if err := db.Error; err != nil {
logger.Errorf(ctx, "Failed to query for triggers: %+v", err)
return nil, err
Expand Down

0 comments on commit 18d6809

Please sign in to comment.