]> git.donarmstrong.com Git - infobot.git/commitdiff
Added miscCheck(), now does reloadAllModules()
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 14 Sep 2000 12:11:50 +0000 (12:11 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 14 Sep 2000 12:11:50 +0000 (12:11 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@98 c11ca15a-4712-0410-83d8-924469b57eb5

src/IRC/Schedulers.pl

index 59b19c3c4cfb1a1e98ace18f5fa9b326f74484aa..81cf57e29893bb6a8686666f4b366721c51ee8c1 100644 (file)
@@ -25,6 +25,7 @@ sub setupSchedulers {
     &ignoreListCheck(1);# mandatory
     &seenFlushOld(1)   if (&IsParam("seen"));
     &ircCheck(1);      # mandatory
+    &miscCheck(1);     # mandatory
     &shmFlush(1);      # mandatory
     &slashdotCycle(1)  if (&IsParam("slashdot") and &IsParam("slashdotAnnounce"));
     &freshmeatCycle(1) if (&IsParam("freshmeat") and &IsParam("freshmeatAnnounce"));
@@ -399,6 +400,26 @@ sub ircCheck {
        &FIXME("ircCheck: current channels * 2 <= config channels. FIXME.");
     }
 
+    if (!$conn->connected and time - $msgtime > 3600) {
+       &WARN("ircCheck: no msg for 3600 and disco'd! reconnecting!");
+       $msgtime = time();      # just in case.
+       &ircloop();
+    }
+
+    if ($ident !~ /^\Q$param{ircNick}\E$/) {
+       &WARN("ircCheck: ident($ident) != param{ircNick}($param{IrcNick}).");
+    }
+
+    if (scalar @joinchan) {
+       &WARN("We have some channels to join, doing so.");
+       &joinNextChan();
+    }
+
+    &ScheduleThis(240, "ircCheck") if (@_);
+}
+
+sub miscCheck {
+    # SHM check.
     my @ipcs;
     if ( -x "/usr/bin/ipcs") {
        @ipcs = `/usr/bin/ipcs`;
@@ -420,22 +441,10 @@ sub ircCheck {
        system("/usr/bin/ipcrm shm $shmid >/dev/null");
     }
 
-    if (!$conn->connected and time - $msgtime > 3600) {
-       &WARN("ircCheck: no msg for 3600 and disco'd! reconnecting!");
-       $msgtime = time();      # just in case.
-       &ircloop();
-    }
-
-    if ($ident !~ /^\Q$param{ircNick}\E$/) {
-       &WARN("ircCheck: ident($ident) != param{ircNick}($param{IrcNick}).");
-    }
-
-    if (scalar @joinchan) {
-       &WARN("We have some channels to join, doing so.");
-       &joinNextChan();
-    }
+    ### check modules if they've been modified. might be evil.
+    &reloadAllModules();
 
-    &ScheduleThis(240, "ircCheck") if (@_);
+    &ScheduleThis(240, "miscCheck") if (@_);
 }
 
 sub shmFlush {