From 7f36e99443966dce3b2f20240569c1ca73e08b42 Mon Sep 17 00:00:00 2001 From: Joe Lothan Date: Tue, 19 May 2026 23:37:50 -0400 Subject: [PATCH] updated random value to double precision float --- pipeline/01_cc_index/schema.sql | 2 +- pipeline/05_bundle_gen/db.go | 4 ++-- pipeline/05_bundle_gen/main.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pipeline/01_cc_index/schema.sql b/pipeline/01_cc_index/schema.sql index d4367c3..5609628 100644 --- a/pipeline/01_cc_index/schema.sql +++ b/pipeline/01_cc_index/schema.sql @@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS hosts ( iframe_allowed BOOLEAN, best_icon_s3_key TEXT, parsed BOOLEAN DEFAULT FALSE, - random_order REAL DEFAULT random() + random_order DOUBLE PRECISION DEFAULT random() ); CREATE TABLE IF NOT EXISTS icons ( diff --git a/pipeline/05_bundle_gen/db.go b/pipeline/05_bundle_gen/db.go index 49b1885..2536158 100644 --- a/pipeline/05_bundle_gen/db.go +++ b/pipeline/05_bundle_gen/db.go @@ -13,11 +13,11 @@ type HostRow struct { HtmlTitle string IframeAllowed bool BestIconS3Key string - RandomOrder float32 + RandomOrder float64 } // fetchHostsPage gets a page of hosts with titles, ordered by random_order for shuffled bundles. -func fetchHostsPage(ctx context.Context, pool *pgxpool.Pool, lastRandom float32, limit int) ([]HostRow, error) { +func fetchHostsPage(ctx context.Context, pool *pgxpool.Pool, lastRandom float64, limit int) ([]HostRow, error) { rows, err := pool.Query(ctx, ` SELECT id, hostname, protocol, html_title, COALESCE(iframe_allowed, true), COALESCE(best_icon_s3_key, ''), random_order FROM hosts diff --git a/pipeline/05_bundle_gen/main.go b/pipeline/05_bundle_gen/main.go index db9133a..7e7644c 100644 --- a/pipeline/05_bundle_gen/main.go +++ b/pipeline/05_bundle_gen/main.go @@ -120,7 +120,7 @@ func main() { bundleCount := 0 var totalBytes int64 - var lastRandom float32 = -1 + var lastRandom float64 = -1 pageSize := cfg.EntriesPerBundle * 50 // fetch 50 bundles worth at a time var entryBuf []BundleEntry hostsProcessed := 0