Skip to content

Commit

Permalink
Turn off archiving again to evalute
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwarden committed Nov 23, 2024
1 parent 820df9a commit 03c3fd6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ func (app app) mainLoop(ctx context.Context) {
logger.Error("crawlAndPostprocess", err)
}

err := app.archiveOldStatsData(ctx)
if err != nil {
app.logger.Error("archiveOldStatsData", err)
}
// err := app.archiveOldStatsData(ctx)
// if err != nil {
// app.logger.Error("archiveOldStatsData", err)
// }

app.logger.Debug("Finished crawl and postprocess")

Expand Down
3 changes: 2 additions & 1 deletion sql/delete-old-data.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- 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 where sampletime <= unixepoch()-30*24*60*60
delete from dataset where ids in (select distinct id from dataset where sampletime <= unixepoch()-28*24*60*60);
update dataset set archived = 0;

0 comments on commit 03c3fd6

Please sign in to comment.