From 8f504bbaeb09f051eee93a27ea447ad24acaef5f Mon Sep 17 00:00:00 2001 From: Rene Krenn Date: Thu, 16 May 2024 11:46:45 +0200 Subject: [PATCH] MT#60120 allow SQLite to use aux threads https://www.sqlite.org/pragma.html#pragma_threads Change-Id: I025e175b4a9efd299269492a8be34e2d54eb4263 (cherry picked from commit ab37cf4ea6d4d287055c8ac97b8744357c52abed) --- lib/NGCP/BulkProcessor/SqlConnectors/SQLiteDB.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/NGCP/BulkProcessor/SqlConnectors/SQLiteDB.pm b/lib/NGCP/BulkProcessor/SqlConnectors/SQLiteDB.pm index 3eb925f..47f0dda 100644 --- a/lib/NGCP/BulkProcessor/SqlConnectors/SQLiteDB.pm +++ b/lib/NGCP/BulkProcessor/SqlConnectors/SQLiteDB.pm @@ -5,7 +5,8 @@ use strict; use NGCP::BulkProcessor::Globals qw( $local_db_path - $LongReadLen_limit); + $LongReadLen_limit + $cpucount); use NGCP::BulkProcessor::Logging qw( getlogger dbinfo @@ -269,6 +270,10 @@ sub db_connect { #PRAGMA locking_mode = NORMAL ... by default #$self->db_do('PRAGMA auto_vacuum = INCREMENTAL'); #$self->db_do('PRAGMA read_uncommitted = ' . $read_uncommitted_isolation_level); + + if ($cpucount) { + $self->db_do('PRAGMA threads = ' . $cpucount); + } if ($local_db_path and ($filemode == $staticdbfilemode or $filemode == $timestampdbfilemode)) { $self->db_do("PRAGMA temp_store_directory = '$local_db_path'"); }