Skip to content

Commit

Permalink
temp: remove step run events
Browse files Browse the repository at this point in the history
  • Loading branch information
abelanger5 committed Jan 8, 2025
1 parent 740081b commit 78e70b0
Showing 1 changed file with 32 additions and 30 deletions.
62 changes: 32 additions & 30 deletions pkg/repository/prisma/buffer_step_run_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,42 +205,44 @@ func bulkStepRunEvents(
messages []string,
data []map[string]interface{},
) error {
inputData := [][]byte{}
inputReasons := []string{}
inputSeverities := []string{}
return nil

for _, d := range data {
dataBytes, err := json.Marshal(d)
// inputData := [][]byte{}
// inputReasons := []string{}
// inputSeverities := []string{}

if err != nil {
l.Err(err).Msg("could not marshal deferred step run event data")
return err
}
// for _, d := range data {
// dataBytes, err := json.Marshal(d)

inputData = append(inputData, dataBytes)
}
// if err != nil {
// l.Err(err).Msg("could not marshal deferred step run event data")
// return err
// }

for _, r := range reasons {
inputReasons = append(inputReasons, string(r))
}
// inputData = append(inputData, dataBytes)
// }

for _, s := range severities {
inputSeverities = append(inputSeverities, string(s))
}
// for _, r := range reasons {
// inputReasons = append(inputReasons, string(r))
// }

err := queries.BulkCreateStepRunEvent(ctx, dbtx, dbsqlc.BulkCreateStepRunEventParams{
Steprunids: stepRunIds,
Reasons: inputReasons,
Severities: inputSeverities,
Messages: messages,
Data: inputData,
Timeseen: timeSeen,
})
// for _, s := range severities {
// inputSeverities = append(inputSeverities, string(s))
// }

if err != nil {
l.Error().Err(err).Msg("could not create deferred step run event")
return fmt.Errorf("bulk_events - could not create deferred step run event: %w", err)
}
// err := queries.BulkCreateStepRunEvent(ctx, dbtx, dbsqlc.BulkCreateStepRunEventParams{
// Steprunids: stepRunIds,
// Reasons: inputReasons,
// Severities: inputSeverities,
// Messages: messages,
// Data: inputData,
// Timeseen: timeSeen,
// })

return nil
// if err != nil {
// l.Error().Err(err).Msg("could not create deferred step run event")
// return fmt.Errorf("bulk_events - could not create deferred step run event: %w", err)
// }

// return nil
}

0 comments on commit 78e70b0

Please sign in to comment.