From: dms Date: Thu, 14 Sep 2000 12:11:50 +0000 (+0000) Subject: Added miscCheck(), now does reloadAllModules() X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d7c5e3b98d11cf4b49a5caa0ae44a760b1f92057;p=infobot.git Added miscCheck(), now does reloadAllModules() git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@98 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/blootbot/src/IRC/Schedulers.pl b/blootbot/src/IRC/Schedulers.pl index 59b19c3..81cf57e 100644 --- a/blootbot/src/IRC/Schedulers.pl +++ b/blootbot/src/IRC/Schedulers.pl @@ -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 {