mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
wip
This commit is contained in:
@@ -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'));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -30,6 +30,14 @@ class CliRequestLogger extends Logger
|
||||
$this->requests = new Collection();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ConsoleOutputInterface
|
||||
*/
|
||||
public function getOutput()
|
||||
{
|
||||
return $this->output;
|
||||
}
|
||||
|
||||
public function logRequest(LoggedRequest $loggedRequest)
|
||||
{
|
||||
if ($this->requests->has($loggedRequest->id())) {
|
||||
|
||||
@@ -37,7 +37,9 @@ class ControlConnection
|
||||
{
|
||||
$this->socket->send(json_encode([
|
||||
'event' => 'setMaximumConnectionLength',
|
||||
'length' => $maximumConnectionLength,
|
||||
'data' => [
|
||||
'length' => $maximumConnectionLength,
|
||||
],
|
||||
]));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user