1
0
Fork 0
mirror of synced 2024-05-16 18:52:33 +12:00

fix: realtime startup

This commit is contained in:
Torsten Dittmann 2022-01-03 15:06:40 +01:00
parent 806bb4ee03
commit 473fdf451e
2 changed files with 2 additions and 4 deletions

View file

@ -110,6 +110,7 @@ function getDatabase(Registry &$register, string $namespace)
};
$server->onStart(function () use ($stats, $register, $containerId, &$statsDocument, $logError) {
sleep(5); // wait for the initial database schema to be ready
Console::success('Server started succefully');
/**
@ -138,7 +139,7 @@ $server->onStart(function () use ($stats, $register, $containerId, &$statsDocume
/**
* Save current connections to the Database every 5 seconds.
*/
Timer::tick(5000, function () use ($register, $stats, $containerId, &$statsDocument, $logError) {
Timer::tick(5000, function () use ($register, $stats, &$statsDocument, $logError) {
/** @var Document $statsDocument */
foreach ($stats as $projectId => $value) {
$connections = $stats->get($projectId, 'connections') ?? 0;

View file

@ -40,9 +40,6 @@ trait RealtimeBase
public function testConnectionFailureMissingChannels(): void
{
/**
* Test for FAILURE
*/
$client = $this->getWebsocket();
$payload = json_decode($client->receive(), true);