Compare commits

...

2 Commits

Author SHA1 Message Date
bel 141c0e5100 forget it 30d
cicd / ci (push) Successful in 3m12s
2026-06-28 09:35:43 -06:00
bel 9f3de791f9 fix killnig and 55h 2026-06-28 09:35:22 -06:00
+7 -2
View File
@@ -146,7 +146,12 @@ func (s S) collectGarbage(ctx context.Context) error {
c := time.NewTicker(time.Hour) c := time.NewTicker(time.Hour)
defer c.Stop() defer c.Stop()
for range c.C { for {
select {
case <-c.C:
case <-ctx.Done():
return nil
}
if _, err := s.ExecContext(ctx, ` if _, err := s.ExecContext(ctx, `
DELETE FROM "pinger_pings" DELETE FROM "pinger_pings"
WHERE WHERE
@@ -155,7 +160,7 @@ func (s S) collectGarbage(ctx context.Context) error {
ms < 100 ms < 100
OR ok OR ok
) )
`, time.Now().Add(-1*12*time.Hour).Unix()); err != nil { `, time.Now().Add(-1*30*24*time.Hour).Unix()); err != nil {
log.Println("!", err) log.Println("!", err)
} }
} }