mirror of
https://github.com/danog/MadelineProto.git
synced 2025-01-22 15:51:15 +01:00
cs-fix
This commit is contained in:
parent
13873c8f56
commit
be6db61966
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ abstract class SettingsAbstract
|
||||
* Get whether this setting was changed, also applies changes.
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function hasChanged(): bool
|
||||
|
Loading…
x
Reference in New Issue
Block a user