Unify storage ID queries under one implementation

This commit is contained in:
Ian Gulliver
2026-10-21 11:58:42 -07:00
parent 069474e6aa
commit abe4d7c9d5
6 changed files with 37 additions and 117 deletions
+1 -16
View File
@@ -257,22 +257,7 @@ func (s *Store) StageOutput(ctx context.Context, sessionID string) (string, erro
}
func (s *Store) FinishedStages(ctx context.Context) ([]string, error) {
rows, err := s.db.QueryContext(ctx, `SELECT id FROM agent_sessions WHERE stage_finished = 1 ORDER BY created_at`)
if err != nil {
return nil, err
}
defer rows.Close()
ids := []string{}
for rows.Next() {
id := ""
err = rows.Scan(&id)
if err != nil {
return nil, err
}
ids = append(ids, id)
}
return ids, rows.Err()
return queryIDs(ctx, s.db, `SELECT id FROM agent_sessions WHERE stage_finished = 1 ORDER BY created_at`)
}
func (s *Store) ClearStage(ctx context.Context, sessionID string) error {