mirror of
https://github.com/cytopia/devilbox.git
synced 2025-01-18 18:56:25 +00:00
Fix loading times to find available services
This commit is contained in:
parent
b5c3b13dce
commit
e713c72bfa
@ -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()) {
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user