This commit is contained in:
Marcel Pociot 2018-12-03 21:44:43 +01:00
parent 8bd50f0e61
commit 56bee170a9
2 changed files with 4 additions and 6 deletions

View File

@ -16,6 +16,7 @@ use Illuminate\Console\Command;
use BeyondCode\LaravelWebSockets\Server\WebSocketServerFactory;
use React\EventLoop\Factory as LoopFactory;
use React\Socket\Connector;
class StartWebSocketServer extends Command
{
@ -46,9 +47,9 @@ class StartWebSocketServer extends Command
protected function configureStatisticsLogger()
{
$connector = new \React\Socket\Connector($this->loop, array(
$connector = new Connector($this->loop, [
'dns' => '127.0.0.1'
));
]);
$browser = new Browser($this->loop, $connector);
@ -57,8 +58,7 @@ class StartWebSocketServer extends Command
return new HttpStatisticsLogger(app(ChannelManager::class), $browser);
});
$this->loop->addPeriodicTimer(5, function() {
echo 'saving stats...';
$this->loop->addPeriodicTimer(60, function() {
StatisticsLogger::save();
});

View File

@ -65,8 +65,6 @@ class HttpStatisticsLogger implements StatisticsLogger
public function save()
{
echo 'in actual save method';
foreach ($this->statistics as $appId => $statistic) {
if (!$statistic->isEnabled()) {