Skip to content

Commit

Permalink
prune runs then instances, 2 (#539)
Browse files Browse the repository at this point in the history
* prune test runs, then test instances

* move pg creation out of prune function

* fix error

* the entire row
  • Loading branch information
laverya authored Jan 22, 2024
1 parent 24903d6 commit 792ad96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tgapi/pkg/persistence/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func PrunePG(pg *sql.DB, pruneDuration time.Duration) (int, int, error) {

runDeleteQuery := `
DELETE FROM testrun
WHERE ref = any (array(SELECT ref FROM testrun WHERE enqueued_at < $1 ORDER BY enqueued_at LIMIT 1000))`
WHERE ref = any (array(SELECT ref FROM testrun WHERE created_at < $1 ORDER BY created_at LIMIT 1000))`
result, err := pg.Exec(runDeleteQuery, deleteBefore)
if err != nil {
return -1, -1, fmt.Errorf("error deleting testrun entries: %v", err)
Expand Down

0 comments on commit 792ad96

Please sign in to comment.