Skip to content

Commit

Permalink
tmp: don't upsert queue
Browse files Browse the repository at this point in the history
  • Loading branch information
abelanger5 committed Oct 24, 2024
1 parent 21f3922 commit 385be5c
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions pkg/repository/prisma/step_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -2828,27 +2828,29 @@ func (s *stepRunEngineRepository) UpdateStepRunInputSchema(ctx context.Context,
}

func (s *stepRunEngineRepository) doCachedUpsertOfQueue(ctx context.Context, tx dbsqlc.DBTX, tenantId string, innerStepRun *dbsqlc.GetStepRunForEngineRow) error {
cacheKey := fmt.Sprintf("t-%s-q-%s", tenantId, innerStepRun.SRQueue)
return nil

_, err := cache.MakeCacheable(s.queueActionTenantCache, cacheKey, func() (*bool, error) {
err := s.queries.UpsertQueue(
ctx,
tx,
dbsqlc.UpsertQueueParams{
Name: innerStepRun.ActionId,
Tenantid: sqlchelpers.UUIDFromStr(tenantId),
},
)
// cacheKey := fmt.Sprintf("t-%s-q-%s", tenantId, innerStepRun.SRQueue)

if err != nil {
return nil, err
}
// _, err := cache.MakeCacheable(s.queueActionTenantCache, cacheKey, func() (*bool, error) {
// err := s.queries.UpsertQueue(
// ctx,
// tx,
// dbsqlc.UpsertQueueParams{
// Name: innerStepRun.ActionId,
// Tenantid: sqlchelpers.UUIDFromStr(tenantId),
// },
// )

res := true
return &res, nil
})
// if err != nil {
// return nil, err
// }

return err
// res := true
// return &res, nil
// })

// return err
}

func (s *stepRunEngineRepository) QueueStepRun(ctx context.Context, tenantId, stepRunId string, opts *repository.QueueStepRunOpts) (*dbsqlc.GetStepRunForEngineRow, error) {
Expand Down

0 comments on commit 385be5c

Please sign in to comment.