close_and_reopen bugfix
This commit is contained in:
parent
16087b4863
commit
08313ece9c
@ -158,8 +158,8 @@ class API extends APIFactory
|
||||
if (Magic::is_fork() && !Magic::$processed_fork) {
|
||||
\danog\MadelineProto\Logger::log('Detected fork');
|
||||
$this->API->reset_session();
|
||||
foreach ($this->API->datacenter->sockets as $datacenter) {
|
||||
$datacenter->close_and_reopen();
|
||||
foreach ($this->API->datacenter->sockets as $id => $datacenter) {
|
||||
$this->API->close_and_reopen($id);
|
||||
}
|
||||
Magic::$processed_fork = true;
|
||||
}
|
||||
|
@ -133,8 +133,8 @@ class APIFactory
|
||||
if (Magic::is_fork() && !Magic::$processed_fork) {
|
||||
\danog\MadelineProto\Logger::log('Detected fork');
|
||||
$this->API->reset_session();
|
||||
foreach ($this->API->datacenter->sockets as $datacenter) {
|
||||
$datacenter->close_and_reopen();
|
||||
foreach ($this->API->datacenter->sockets as $id => $datacenter) {
|
||||
$this->API->close_and_reopen($id);
|
||||
}
|
||||
Magic::$processed_fork = true;
|
||||
}
|
||||
|
@ -49,8 +49,8 @@ class EventHandler extends APIFactory
|
||||
if (Magic::is_fork() && !Magic::$processed_fork) {
|
||||
\danog\MadelineProto\Logger::log('Detected fork');
|
||||
$this->API->reset_session();
|
||||
foreach ($this->API->datacenter->sockets as $datacenter) {
|
||||
$datacenter->close_and_reopen();
|
||||
foreach ($this->API->datacenter->sockets as $id => $datacenter) {
|
||||
$this->API->close_and_reopen($id);
|
||||
}
|
||||
Magic::$processed_fork = true;
|
||||
}
|
||||
|
@ -772,6 +772,8 @@ trait PeerHandler
|
||||
$offset += count($gres['participants']);
|
||||
} while (count($gres['participants']));
|
||||
|
||||
if ($offset === $limit) return true;
|
||||
|
||||
return $has_more;
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,8 @@ if ($MadelineProto->get_self() === false) {
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(count($MadelineProto->get_pwr_chat('@madelineproto')['participants']));
|
||||
|
||||
/*
|
||||
* Test logging
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user