mirror of
https://github.com/aljazceru/crawler_v2.git
synced 2025-12-17 07:24:21 +01:00
using HLL for all counts to avoid duplicates
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user