Unify storage ID queries under one implementation
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user