summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2023-02-28 16:59:16 +0100
committerUrban Müller2023-02-28 16:59:16 +0100
commit89f5ff8591708188f1d2ccceaac288182ec097ed (patch)
tree33466eae3ff2ff2543871e33f0094cab0b00fa72
parentcb367fb0cd8cc7f0401b7fb326f104d7a31aead3 (diff)
downloaditools-89f5ff8591708188f1d2ccceaac288182ec097ed.tar.gz
itools-89f5ff8591708188f1d2ccceaac288182ec097ed.tar.bz2
itools-89f5ff8591708188f1d2ccceaac288182ec097ed.zip
half speed writes in batch jobs, goes easy on replication slaves
-rw-r--r--it_dbi.class1
1 files changed, 1 insertions, 0 deletions
diff --git a/it_dbi.class b/it_dbi.class
index 6e34002..9914732 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -78,6 +78,7 @@ function __construct($p = array(), $query = null, ...$args)
$p += $dp;
# Combine our settings with user's defaults and class defaults
+ $this->_defaultconfig['throttle_writes'] = $_SERVER['REMOTE_ADDR'] ? 0 : 1;
$p += (array)$GLOBALS[static::$_global_key . '_defaultconfig'] + array('db' => $GLOBALS['ULTRADB']) + $this->_defaultconfig + array('charset' => strtr(strtolower(ini_get('default_charset')), array('iso-8859-1' => 'latin1', 'utf-8' => 'utf8mb4', 'utf8' => 'utf8mb4')));
unset($this->_defaultconfig); # to shorten ED() output