- added "WAIT_TIMEOUT" and "INTERACTIVE_TIMEOUT" as _MySQL_ required vars to requirements.ini (relevant for persistent DB connections)

- improved DB requirements shown on `/setup` page
- improved _Redis_ Client connections. Added "client name" (https://redis.io/commands/client-setname)
This commit is contained in:
Mark Friedrich
2019-04-18 18:27:46 +02:00
parent a33615445e
commit 5d17f81bb8
7 changed files with 56 additions and 23 deletions

View File

@@ -131,6 +131,12 @@ abstract class AbstractClient extends \Prefab {
Config::REDIS_OPT_READ_TIMEOUT
)
){
if(isset($poolConfig['tag'])){
$name = 'pathfinder|php|tag:' . strtolower($poolConfig['tag']) . '|pid:' . getmypid();
$client->client('setname', $name);
}
if(isset($poolConfig['db'])){
$client->select($poolConfig['db']);
}
@@ -179,7 +185,8 @@ abstract class AbstractClient extends \Prefab {
* @return array
*/
protected function getCachePoolConfig(\Base $f3) : array {
$dsn = (string)$f3->get('API_CACHE');
$tag = 'API_CACHE';
$dsn = (string)$f3->get($tag);
// fallback
$conf = ['type' => 'array'];
@@ -195,6 +202,10 @@ abstract class AbstractClient extends \Prefab {
// redis or filesystem -> overwrites $conf
Config::parseDSN($dsn, $conf);
// tag name is used as alias name e.g. for debugging
// -> e.g. for Redis https://redis.io/commands/client-setname
$conf['tag'] = $tag;
return $conf;
}