git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@368
c11ca15a-4712-0410-83d8-
924469b57eb5
my $error = 0;
my $lastrun = 0;
my $error = 0;
my $lastrun = 0;
+loop:;
+ foreach (shift @ircServers) {
# JUST IN CASE. irq was complaining about this.
if ($lastrun == time()) {
&DEBUG("hrm... lastrun == time()");
# JUST IN CASE. irq was complaining about this.
if ($lastrun == time()) {
&DEBUG("hrm... lastrun == time()");
- foreach (@ircServers) {
- if (!defined $_) {
- &DEBUG("ircloop: ircServers[x] = NULL.");
- $lastrun = time();
- next;
- }
- next unless (exists $ircPort{$_});
+ if (!defined $_) {
+ &DEBUG("ircloop: ircServers[x] = NULL.");
+ $lastrun = time();
+ next;
+ }
+ next unless (exists $ircPort{$_});
- my $retval = &irc($_, $ircPort{$_});
- next unless (defined $retval and $retval == 0);
- $error++;
- if ($error % 3 == 0 and $error != 0) {
- &ERROR("CANNOT connect to this server; next!");
- next;
- }
-
- if ($error >= 3*3) {
- &ERROR("CANNOT connect to any irc server; stopping.");
- exit 1;
- }
+ my $retval = &irc($_, $ircPort{$_});
+ &DEBUG("ircloop: after irc()");
+
+ next unless (defined $retval and $retval == 0);
+
+ $error++;
+
+ if ($error % 3 == 0 and $error != 0) {
+ &ERROR("CANNOT connect to this server; next!");
+ next;
+ }
+
+ if ($error >= 3*3) {
+ &ERROR("CANNOT connect to any irc server; stopping.");
+ exit 1;
+
+ &DEBUG("ircloop: end... going back.");
+ &loadIRCServers();
+ goto loop;