From df2bb0c96080242525c8833555e75c9ddb32f627 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 25 Aug 2017 16:15:23 +0100 Subject: [PATCH] reduced number of blocksync threads to 2 --- cron/blockstuff.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cron/blockstuff.php b/cron/blockstuff.php index 6fa78cf..a2b9f38 100644 --- a/cron/blockstuff.php +++ b/cron/blockstuff.php @@ -19,6 +19,9 @@ class BlockSyncThread extends \Thread { $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $data_error = false; $conn->beginTransaction(); + + // TODO: Batch block synchronisation from memory to DB + for ($curr_height = $this->_startHeight; $curr_height <= $this->_endHeight; $curr_height++) { $idx_str = str_pad($curr_height, strlen($this->_maxHeight), '0', STR_PAD_LEFT); @@ -64,7 +67,7 @@ class BlockStuff { $stmt->execute([]); $max_block = $stmt->fetch(PDO::FETCH_OBJ); if ($max_block) { - $chunk_limit = 10; + $chunk_limit = 2; $curr_height = 0; $chunks = floor($max_block->Height / $chunk_limit); $threads = [];