From c4de671caa28e0774a26cdcc60a0f874c56e2792 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Thu, 1 Feb 2024 16:43:01 +0100 Subject: [PATCH] Set interval to 10000 records --- src/Console/CsvImportCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Console/CsvImportCommand.php b/src/Console/CsvImportCommand.php index 53d054e..888d4c4 100644 --- a/src/Console/CsvImportCommand.php +++ b/src/Console/CsvImportCommand.php @@ -163,8 +163,8 @@ class CsvImportCommand extends Console $progressIndicator->advance(); $progressIndicator->setMessage('Importing... ' . (string) $count . ' records processed.'); - // Flush to database if memory usage reaches limit or every 50.000 records. - if ((memory_get_usage() / $phpMemoryLimit) > $memoryLimit || ($count % 50000) === 0) { + // Flush to database if memory usage reaches limit or every 10.000 records. + if ((memory_get_usage() / $phpMemoryLimit) > $memoryLimit || ($count % 10000) === 0) { $progressIndicator->setMessage('Importing... ' . (string) $count . ' records processed. Flushing to database...'); Database::getInstance()->flush([Record::class]); }