]> git.donarmstrong.com Git - infobot.git/commitdiff
bot: spit out memory change messages in DCC CHAT. TODO: DCCBroadcast should allow...
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 13 Sep 2000 13:03:53 +0000 (13:03 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 13 Sep 2000 13:03:53 +0000 (13:03 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@87 c11ca15a-4712-0410-83d8-924469b57eb5

src/core.pl

index 5f5d8138f1a75c0f8c323e5f829633667615504b..d204fdd188a88eb68a1a1260585b8a5fb382253e 100644 (file)
@@ -70,6 +70,7 @@ sub doExit {
        &closeSHM($shm);
        &dumpallvars()  if (&IsParam("dumpvarsAtExit"));
        &closeLog();
+       &closeSQLDebug()        if (&IsParam("SQLDebug"));
     } else {                                   # child.
        &status("child caught SIG$sig (pid $$).");
     }
@@ -115,15 +116,19 @@ sub showProc {
        if (defined $memusageOld and &IsParam("DEBUG")) {
            # it's always going to be increase.
            my $delta = $memusage - $memusageOld;
+           my $str;
            if ($delta > 500) {
-               &status("MEM:$prefix increased by $delta kB. (total: $memusage kB)");
+               $str = "MEM:$prefix increased by $delta kB. (total: $memusage kB)";
            } elsif ($delta > 0) {
-               &status("MEM:$prefix increased by $delta kB.");
+               $str = "MEM:$prefix increased by $delta kB";
            } elsif ($delta < 0) {
                $delta = -$delta;
                # never knew RSS could decrease, probably Size can't?
-               &status("MEM:$prefix decreased by $delta kB. YES YES YES");
+               $str = "MEM:$prefix decreased by $delta kB. YES YES YES";
            }
+           &status($str);
+           &DCCBroadcast($str) if (&whatInterface() =~ /IRC/ &&
+               grep(/Irc.pl/, keys %moduleAge));
        }
        $memusageOld = $memusage;
     } else {
@@ -147,6 +152,7 @@ sub setup {
     &loadUsers($bot_misc_dir.          "/blootbot.users");
 
     $shm = &openSHM();
+    &openSQLDebug()    if (&IsParam("SQLDebug"));
     &openDB($param{'DBName'}, $param{'SQLUser'}, $param{'SQLPass'});
 
     &status("Setup: ". &countKeys("factoids") ." factoids.");
@@ -206,7 +212,7 @@ sub restart {
 
        &shutdown();
        &loadConfig($bot_misc_dir."/blootbot.config");
-       &reloadModules() if (&IsParam("DEBUG"));
+       &reloadAllModules() if (&IsParam("DEBUG"));
        &setup();
 
        &status("End of $sig.");