From 8b748280a92ab15c624bc8cd51c1eee4c4fb543c Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Mon, 8 Dec 2025 16:17:05 -0700 Subject: [PATCH] while --- cmd/pg-fill/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/pg-fill/main.go b/cmd/pg-fill/main.go index 7fc1b79..7a066fe 100644 --- a/cmd/pg-fill/main.go +++ b/cmd/pg-fill/main.go @@ -57,7 +57,10 @@ func run(ctx context.Context) error { // https://gist.github.com/ololobus/5b25c432f208d7eb31051a5f238dffff // 2e6=1GB, so 2e6/8=12MB - for i := presently() / 12; i < (*n)/12; i++ { + for { + if presently() >= *n { + break + } for ctx.Err() == nil { if _, err := pg.ExecContext(ctx, ` INSERT INTO fill_with_data (x, y, z)