Merge pull request #6612 from MrPetovan/bug/6605-cache-config-adapter-connection
Cache config adapter connection status to reduce number of calls to DBA::isConnected()
This commit is contained in:
commit
f68b3c7c4e
|
@ -6,8 +6,11 @@ use Friendica\Database\DBA;
|
||||||
|
|
||||||
abstract class AbstractDbaConfigAdapter
|
abstract class AbstractDbaConfigAdapter
|
||||||
{
|
{
|
||||||
|
/** @var bool */
|
||||||
|
protected $connected = true;
|
||||||
|
|
||||||
public function isConnected()
|
public function isConnected()
|
||||||
{
|
{
|
||||||
return DBA::connected();
|
return $this->connected;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ class JITConfigAdapter extends AbstractDbaConfigAdapter implements IConfigAdapte
|
||||||
public function __construct(IConfigCache $configCache)
|
public function __construct(IConfigCache $configCache)
|
||||||
{
|
{
|
||||||
$this->configCache = $configCache;
|
$this->configCache = $configCache;
|
||||||
|
$this->connected = DBA::connected();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -27,6 +27,7 @@ class PreloadConfigAdapter extends AbstractDbaConfigAdapter implements IConfigAd
|
||||||
public function __construct(IConfigCache $configCache)
|
public function __construct(IConfigCache $configCache)
|
||||||
{
|
{
|
||||||
$this->configCache = $configCache;
|
$this->configCache = $configCache;
|
||||||
|
$this->connected = DBA::connected();
|
||||||
$this->load();
|
$this->load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user