Optimize stats and TLD queries for performance

- Reduce stats loop interval from 1 minute to 10 seconds
- Simplify TLD query by removing expensive feeds JOIN (30s -> 1.8s)
- Sort TLDs alphabetically

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
primal
2026-01-29 13:00:13 -05:00
parent f780c493c2
commit 8e4993d3c5
2 changed files with 11 additions and 14 deletions
+2 -2
View File
@@ -68,11 +68,11 @@ func (c *Crawler) Close() error {
return nil
}
// StartStatsLoop updates cached stats once per minute
// StartStatsLoop updates cached stats every 10 seconds
func (c *Crawler) StartStatsLoop() {
for {
c.UpdateStats()
time.Sleep(1 * time.Minute)
time.Sleep(10 * time.Second)
}
}