From a9657539941d36f1e4fa95badfcefea25248033b Mon Sep 17 00:00:00 2001
From: dms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Date: Tue, 20 Feb 2001 12:59:09 +0000
Subject: [PATCH] - lobotomy cache flush. - disable uptime if not loaded. -
 minor output update.

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@407 c11ca15a-4712-0410-83d8-924469b57eb5
---
 blootbot/src/IRC/Schedulers.pl | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/blootbot/src/IRC/Schedulers.pl b/blootbot/src/IRC/Schedulers.pl
index a0ab80d..65819a1 100644
--- a/blootbot/src/IRC/Schedulers.pl
+++ b/blootbot/src/IRC/Schedulers.pl
@@ -674,6 +674,12 @@ sub miscCheck {
 	CORE::system("/bin/cp $f $f~");
     }
 
+    # flush cache{lobotomy}
+    foreach (keys %{ $cache{lobotomy} }) {
+	next unless (time() - $cache{lobotomy}{$_} > 60*60);
+	delete $cache{lobotomy}{$_};
+    }
+
     ### check modules if they've been modified. might be evil.
     &reloadAllModules();
 }
@@ -742,6 +748,8 @@ sub getNickInUse {
 }
 
 sub uptimeLoop {
+    return unless &IsChanConf("uptime");
+
     if (@_) {
 	&ScheduleThis(60, "uptimeLoop");
 	return if ($_[0] eq "2");	# defer.
@@ -987,7 +995,7 @@ sub getChanConfDefault {
 
     if (exists $param{$what}) {
 	if (!exists $cache{config}{$what}) {
-	    &status("gCCD: backward-compat: found param{$what} ($param{$what}) instead.");
+	    &status("conf: backward-compat: found param{$what} ($param{$what}) instead.");
 	    $cache{config}{$what} = 1;
 	}
 
@@ -1000,7 +1008,7 @@ sub getChanConfDefault {
     }
 
     $param{$what}	= $default;
-    &status("gCCD: auto-setting param{$what} = $default");
+    &status("conf: auto-setting param{$what} = $default");
     $cache{config}{$what} = 1;
 
     return $default;
-- 
2.39.5