Skip to content

Commit

Permalink
Revert "Don't delete data for stories where there are votes in delete…
Browse files Browse the repository at this point in the history
…-old-data.sql"

This reverts commit aefb54a.
  • Loading branch information
johnwarden committed Aug 25, 2023
1 parent 6fd9c8d commit f598e14
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion database.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ func (ndb newsDatabase) initUpvotesDB() error {
from votes
) select * from exits where direction != 0
`,
`delete from votes where userID < 100`,
}

for _, s := range seedStatements {
Expand Down
2 changes: 1 addition & 1 deletion sql/delete-old-data.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- delete data older than one month. It's taking about 18 days to fill a gig, and we have
-- 3 gig volume currently. That gives us 54 days. But 30 days is plenty and this gives us margin
-- in case the rate of growth of data increases.
delete from dataset left join votes on (id = storyID) where storyID is null and sampletime <= unixepoch()-30*24*60*60
delete from dataset where sampletime <= unixepoch()-30*24*60*60

0 comments on commit f598e14

Please sign in to comment.