backport of commit dea6ca4958

pull/4690/head
Timothy Messier 2 years ago
parent be19cc106a
commit e4c7eaffee

@ -416,8 +416,8 @@ func (r *ConnectionRepository) closeOrphanedConnections(ctx context.Context, wor
ctx, ctx,
db.StdRetryCnt, db.StdRetryCnt,
db.ExpBackoff{}, db.ExpBackoff{},
func(reader db.Reader, w db.Writer) error { func(_ db.Reader, w db.Writer) error {
rows, err := r.reader.Query(ctx, fmt.Sprintf(orphanedConnectionsCte, notInClause), args) rows, err := w.Query(ctx, fmt.Sprintf(orphanedConnectionsCte, notInClause), args)
if err != nil { if err != nil {
return errors.Wrap(ctx, err, op) return errors.Wrap(ctx, err, op)
} }

@ -830,9 +830,9 @@ func (r *Repository) CheckIfNotActive(ctx context.Context, reportedSessions []st
ctx, ctx,
db.StdRetryCnt, db.StdRetryCnt,
db.ExpBackoff{}, db.ExpBackoff{},
func(reader db.Reader, w db.Writer) error { func(reader db.Reader, _ db.Writer) error {
var states []*State var states []*State
err := r.reader.SearchWhere(ctx, &states, "end_time is null and session_id in (?)", []any{reportedSessions}) err := reader.SearchWhere(ctx, &states, "end_time is null and session_id in (?)", []any{reportedSessions})
if err != nil { if err != nil {
return errors.Wrap(ctx, err, op) return errors.Wrap(ctx, err, op)
} }

Loading…
Cancel
Save