Compare commits

..

4 Commits

Author SHA1 Message Date
bel 439c481c60 log err
cicd / ci (push) Successful in 3m25s
2026-07-07 17:16:08 -06:00
bel 0a58f85ca3 2d cause only reaps sad
cicd / ci (push) Successful in 2m56s
2026-06-28 09:42:07 -06:00
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
+9 -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*2*24*time.Hour).Unix()); err != nil {
log.Println("!", err) log.Println("!", err)
} }
} }
@@ -246,6 +251,8 @@ func (s S) pingAndRecord(ctx context.Context) error {
} }
if err == nil { if err == nil {
conn.Close() conn.Close()
} else {
log.Println("!", err)
} }
}() }()
} }