Add a few breaks to avoid connection flooding for the irc-bot (#14479)

* Add a few breaks to avoid connection flooding

Adding a few sleep()s in the connection loop to avoid connection flooding on errors.

* Add lost bracket

* Add linebreaks to please StyleCi

* More Ci
This commit is contained in:
Olen
2022-10-25 23:10:35 +02:00
committed by GitHub
parent c2678c1b6c
commit 339e3c28be

View File

@ -158,7 +158,11 @@ class IRCBot
private function init() private function init()
{ {
if ($this->config['irc_alert']) { if ($this->config['irc_alert']) {
$this->connectAlert(); if (! $this->connectAlert()) {
sleep(5);
return false;
}
} }
$this->last_activity = time(); $this->last_activity = time();
@ -205,6 +209,7 @@ class IRCBot
usleep($this->tick); usleep($this->tick);
} }
sleep(10);
return $this->init(); return $this->init();
} }