From 010c769b556511c8bb86464ceaa26522f9f47839 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Fri, 29 Nov 2024 10:00:18 +0000 Subject: [PATCH] Stream 50 rows at a time for batch operations --- lib/music_library/records/batch.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/music_library/records/batch.ex b/lib/music_library/records/batch.ex index 0041c56e..4bc5e8f6 100644 --- a/lib/music_library/records/batch.ex +++ b/lib/music_library/records/batch.ex @@ -54,7 +54,7 @@ defmodule MusicLibrary.Records.Batch do defp run_on_all_records(fun) do q = from(r in Record) - stream = Repo.stream(q) + stream = Repo.stream(q, max_rows: 50) Repo.transaction( fn ->