realtime connection
This commit is contained in:
parent
c108de4f14
commit
397ce215e0
1 changed files with 11 additions and 1 deletions
|
@ -136,6 +136,16 @@ if (!function_exists("getCache")) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!function_exists("getPubSub")) {
|
||||
function getPubSub(): Cache
|
||||
{
|
||||
global $register;
|
||||
|
||||
$pools = $register->get('pools'); /** @var \Utopia\Pools\Group $pools */
|
||||
return $pools->get('pubsub')->pop()->getResource();
|
||||
}
|
||||
}
|
||||
|
||||
$realtime = new Realtime();
|
||||
|
||||
/**
|
||||
|
@ -355,7 +365,7 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats,
|
|||
}
|
||||
$start = time();
|
||||
|
||||
$redis = $register->get('pools')->get('pubsub')->pop()->getResource(); /** @var Redis $redis */
|
||||
$redis = getPubSub(); /** @var Redis $redis */
|
||||
$redis->setOption(Redis::OPT_READ_TIMEOUT, -1);
|
||||
|
||||
if ($redis->ping(true)) {
|
||||
|
|
Loading…
Reference in a new issue