From a4fde4fc5e42ea45ca0278c90cdb3d085d92accf Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 4 Jul 2020 15:30:53 +0300 Subject: [PATCH] Added PDO persistent connection --- app/init.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/init.php b/app/init.php index 5ee9f6e33f..adc4e5c4f8 100644 --- a/app/init.php +++ b/app/init.php @@ -91,7 +91,8 @@ $register->set('db', function () { // Register DB connection $pdo = new PDO("mysql:host={$dbHost};dbname={$dbScheme};charset=utf8mb4", $dbUser, $dbPass, array( PDONative::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4', - PDONative::ATTR_TIMEOUT => 5, // Seconds + PDONative::ATTR_TIMEOUT => 3, // Seconds + PDONative::ATTR_PERSISTENT => true )); // Connection settings