mirror of
https://github.com/ddworken/hishtory.git
synced 2024-12-23 23:39:02 +01:00
Update deep clean code to actually execute the delete now that I validated that it is reasonable
This commit is contained in:
parent
0c39dbf27c
commit
f3c8ecc9e6
@ -399,7 +399,7 @@ func (db *DB) DeepClean(ctx context.Context) error {
|
||||
return r.Error
|
||||
}
|
||||
r = tx.Exec(`
|
||||
SELECT COUNT(*) FROM enc_history_entries WHERE
|
||||
DELETE FROM enc_history_entries WHERE
|
||||
date <= (now() - INTERVAL '180 days')
|
||||
AND user_id IN (SELECT * FROM temp_users_with_one_device)
|
||||
AND user_id IN (SELECT * FROM temp_inactive_users)
|
||||
|
@ -90,7 +90,7 @@ func (s *Server) Run(ctx context.Context, addr string) error {
|
||||
defer configureObservability(mux, s.releaseVersion)()
|
||||
go func() {
|
||||
if err := s.db.DeepClean(ctx); err != nil {
|
||||
panic(err)
|
||||
fmt.Println("failed to deep clean: %w", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user