Apply fixes from StyleCI
This commit is contained in:
parent
e2aef54979
commit
05a73fbe31
@ -127,6 +127,7 @@ class API extends APIFactory
|
||||
\danog\MadelineProto\Logger::log('Detected fork');
|
||||
$this->API->__wakeup();
|
||||
}
|
||||
|
||||
return $this->API->__construct($value);
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ class APIFactory
|
||||
if (Logger::is_fork()) {
|
||||
\danog\MadelineProto\Logger::log('Detected fork');
|
||||
$this->API->reset_session();
|
||||
foreach ($this->API->datacenter->sockets as $datacenter) {
|
||||
foreach ($this->API->datacenter->sockets as $datacenter) {
|
||||
$datacenter->close_and_reopen();
|
||||
}
|
||||
}
|
||||
|
@ -68,10 +68,12 @@ class Logger
|
||||
}
|
||||
}
|
||||
|
||||
public static function is_fork() {
|
||||
public static function is_fork()
|
||||
{
|
||||
if (self::$pid === null) {
|
||||
self::$pid = getmypid();
|
||||
}
|
||||
|
||||
return self::$pid !== getmypid();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user