1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-22 15:51:15 +01:00
This commit is contained in:
Daniil Gentili 2021-05-11 15:56:31 +02:00
parent 13873c8f56
commit be6db61966
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
3 changed files with 6 additions and 4 deletions

View File

@ -445,7 +445,7 @@ class API extends InternalDoc
}
$errors = [];
$started = array_fill_keys(array_keys($instances), false);
$started = \array_fill_keys(\array_keys($instances), false);
$instanceOne = \array_values($instances)[0];
while (true) {
try {
@ -460,7 +460,7 @@ class API extends InternalDoc
$t = \time();
$errors = [$t => $errors[$t] ?? 0];
$errors[$t]++;
if ($errors[$t] > 10 && array_sum($started) !== count($eventHandler)) {
if ($errors[$t] > 10 && \array_sum($started) !== \count($eventHandler)) {
$instanceOne->logger("More than 10 errors in a second and not inited, exiting!", Logger::FATAL_ERROR);
return;
}

View File

@ -1281,7 +1281,9 @@ class MTProto extends AsyncConstruct implements TLCallback
if ($this->event_handler && \class_exists($this->event_handler) && \is_subclass_of($this->event_handler, EventHandler::class)) {
yield from $this->setEventHandler($this->event_handler);
} else {
$this->setNoop();
if ($this->updateHandler === [$this, 'eventUpdateHandler']) {
$this->setNoop();
}
$this->event_handler = null;
$this->event_handler_instance = null;
}

View File

@ -80,7 +80,7 @@ abstract class SettingsAbstract
* Get whether this setting was changed, also applies changes.
*
* @internal
*
*
* @return boolean
*/
public function hasChanged(): bool