From 25d7a5286d3948cfa1300ac01284a8b219cdbb57 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Fri, 27 Oct 2023 09:40:59 +0200 Subject: [PATCH] Fix chunk size of clone volume job The insert has 8 parameters per item and 10k items exceeded the 65k parameter limit. --- app/Jobs/CloneImagesOrVideos.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Jobs/CloneImagesOrVideos.php b/app/Jobs/CloneImagesOrVideos.php index b2ef17123..f087975d4 100644 --- a/app/Jobs/CloneImagesOrVideos.php +++ b/app/Jobs/CloneImagesOrVideos.php @@ -202,7 +202,9 @@ private function copyImages($volume, $copy, $selectedImageIds) $original['uuid'] = (string)Uuid::uuid4(); unset($original['id']); return $original; - })->chunk(10000)->each(function ($chunk) { + }) + ->chunk(1000) + ->each(function ($chunk) { Image::insert($chunk->toArray()); }); @@ -357,7 +359,9 @@ private function copyVideos($volume, $copy, $selectedVideoIds) $original['uuid'] = (string)Uuid::uuid4(); unset($original['id']); return $original; - })->chunk(10000)->each(function ($chunk) { + }) + ->chunk(1000) + ->each(function ($chunk) { Video::insert($chunk->toArray()); });