Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
abelanger5 committed Aug 5, 2024
1 parent 61b3541 commit c4e6032
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pkg/repository/prisma/step_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,18 @@ func (s *stepRunEngineRepository) QueueStepRuns(ctx context.Context, tenantId st
slotsToActions[slotId] = append(slotsToActions[slotId], slot.ActionId)
}

// print debug information
for action, slots := range actionsToSlots {
s.l.Warn().Msg(fmt.Sprintf(
"Starting Action Slots{\n"+
" Action: %s\n"+
" Slots: %d\n"+
"}",
action,
len(slots),
))
}

// match slots to step runs in the order the step runs were returned
stepRunIds := make([]pgtype.UUID, 0)
slotIds := make([]pgtype.UUID, 0)
Expand Down Expand Up @@ -1060,6 +1072,18 @@ func (s *stepRunEngineRepository) QueueStepRuns(ctx context.Context, tenantId st
return nil, false, fmt.Errorf("could not commit transaction: %w", err)
}

// print debug information
for action, slots := range actionsToSlots {
s.l.Warn().Msg(fmt.Sprintf(
"Ending Action Slots{\n"+
" Action: %s\n"+
" Slots: %d\n"+
"}",
action,
len(slots),
))
}

// if at least one of the actions got all step runs assigned, and there are slots remaining, return true
for action := range uniqueActions {
if _, ok := exhaustedActions[action]; !ok {
Expand Down

0 comments on commit c4e6032

Please sign in to comment.