using HLL for all counts to avoid duplicates

This commit is contained in:
pippellia-btc
2025-09-15 16:21:17 +02:00
parent 416e735552
commit d176d8c81d
3 changed files with 86 additions and 34 deletions

View File

@@ -7,6 +7,8 @@ import (
"time"
"github.com/nbd-wtf/go-nostr"
"github.com/redis/go-redis/v9"
"github.com/vertex-lab/crawler_v2/pkg/redb"
)
var (
@@ -56,3 +58,15 @@ func TestFetch(t *testing.T) {
t.Fatalf("expected %d events, got %d", expected, len(events))
}
}
// Manually check on a test database
func TestFinalizeStats(t *testing.T) {
db := redb.New(&redis.Options{
Addr: "localhost:6379",
})
err := finalizeStats(db, "2025-09-15")
if err != nil {
t.Fatalf("expected nil, got %v", err)
}
}