Improve test coverage

This commit is contained in:
2026-03-05 18:07:33 +00:00
parent 1e0bb0be8c
commit ccb8267813
8 changed files with 7550 additions and 49 deletions

View File

@@ -148,7 +148,20 @@ func (s *SQLStore) Size() int {
}
func (s *SQLStore) cleanup() {
ticker := time.NewTicker(1 * time.Minute)
// Calculate cleanup interval as 10% of TTL, with sensible bounds
interval := s.ttl / 10
// Cap maximum interval at 1 minute for production
if interval > 1*time.Minute {
interval = 1 * time.Minute
}
// Allow small intervals for testing (as low as 10ms)
if interval < 10*time.Millisecond {
interval = 10 * time.Millisecond
}
ticker := time.NewTicker(interval)
defer ticker.Stop()
for {