Fix loading times to find available services

This commit is contained in:
cytopia 2018-04-08 12:18:44 +02:00
parent b5c3b13dce
commit e713c72bfa
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
3 changed files with 13 additions and 15 deletions

View File

@ -37,7 +37,7 @@ class Mysql extends BaseClass implements BaseInterface
// Silence errors and try to connect
error_reporting(0);
$link = mysqli_connect($hostname, $user, $pass);
$link = @mysqli_connect($hostname, $user, $pass);
error_reporting(-1);
if (mysqli_connect_errno()) {

View File

@ -45,9 +45,9 @@ class Pgsql extends BaseClass implements BaseInterface
// Silence errors and try to connect
error_reporting(0);
if ($db !== null) {
$link = pg_connect('host='.$hostname.' dbname='.$db.' user='.$user.' password='.$pass);
$link = @pg_connect('host='.$hostname.' dbname='.$db.' user='.$user.' password='.$pass);
} else {
$link = pg_connect('host='.$hostname.' user='.$user.' password='.$pass);
$link = @pg_connect('host='.$hostname.' user='.$user.' password='.$pass);
}
error_reporting(-1);

View File

@ -37,19 +37,17 @@ class Redis extends BaseClass implements BaseInterface
{
parent::__construct($hostname, $data);
// Silence errors and try to connect
error_reporting(0);
$redis = new \Redis();
if (!$redis->connect($hostname, 6379)) {
$this->setConnectError('Failed to connect to Redis host on '.$hostname);
$this->setConnectErrno(1);
//loadClass('Logger')->error($this->_connect_error);
} else {
$redis->set('devilbox-version', $GLOBALS['DEVILBOX_VERSION'].' ('.$GLOBALS['DEVILBOX_DATE'].')');
$this->_redis = $redis;
if ($this->isAvailable()) {
$redis = new \Redis();
if (!@$redis->connect($hostname, 6379, 0.5, NULL)) {
$this->setConnectError('Failed to connect to Redis host on '.$hostname);
$this->setConnectErrno(1);
//loadClass('Logger')->error($this->_connect_error);
} else {
$redis->set('devilbox-version', $GLOBALS['DEVILBOX_VERSION'].' ('.$GLOBALS['DEVILBOX_DATE'].')');
$this->_redis = $redis;
}
}
error_reporting(-1);
}
/**