From 67fd15f5435a3960a647ab26d7b7fbac9e41dca4 Mon Sep 17 00:00:00 2001 From: Jakub Onderka Date: Sun, 27 Mar 2022 18:28:00 +0200 Subject: [PATCH] chg: [warninglist] Insert in bigger chunks --- app/Model/Warninglist.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Model/Warninglist.php b/app/Model/Warninglist.php index 3ae8f2218..cdf7c2886 100644 --- a/app/Model/Warninglist.php +++ b/app/Model/Warninglist.php @@ -383,7 +383,7 @@ class Warninglist extends AppModel $keys = array_keys($list['list']); if ($keys === array_keys($keys)) { - foreach (array_chunk($list['list'], 500) as $chunk) { + foreach (array_chunk($list['list'], 1000) as $chunk) { $valuesToInsert = []; foreach ($chunk as $value) { if (!empty($value)) { @@ -393,7 +393,7 @@ class Warninglist extends AppModel $result = $db->insertMulti('warninglist_entries', ['value', 'warninglist_id'], $valuesToInsert); } } else { // import warninglist with comments - foreach (array_chunk($list['list'], 500, true) as $chunk) { + foreach (array_chunk($list['list'], 1000, true) as $chunk) { $valuesToInsert = []; foreach ($chunk as $value => $comment) { if (!empty($value)) {