1
0
Fork 0
mirror of synced 2024-09-19 19:07:21 +12:00

realtime connection

This commit is contained in:
shimon 2024-09-03 22:13:32 +03:00
parent c108de4f14
commit 397ce215e0

View file

@ -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)) {