This commit is contained in:
Marcel Pociot
2020-05-03 22:35:22 +02:00
parent 0325162718
commit f0accd908d
3 changed files with 16 additions and 3 deletions

View File

@@ -96,12 +96,15 @@ class Client
});
$connection->on('setMaximumConnectionLength', function ($data) {
$this->loop->addPeriodicTimer(1, function() use ($data) {
$timeoutSection = $this->logger->getOutput()->section();
$this->loop->addPeriodicTimer(1, function() use ($data, $timeoutSection) {
$this->timeConnected++;
$carbon = Carbon::createFromFormat('s', str_pad($data->length * 60 - $this->timeConnected, 2, 0, STR_PAD_LEFT));
$this->logger->info('Remaining time: '.$carbon->format('H:i:s'));
$timeoutSection->clear();
$timeoutSection->writeln('Remaining time: '.$carbon->format('H:i:s'));
});
});