]> git.donarmstrong.com Git - infobot.git/commitdiff
verbose on reload (time ago, delta time)
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 22 Sep 2000 10:48:42 +0000 (10:48 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 22 Sep 2000 10:48:42 +0000 (10:48 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@120 c11ca15a-4712-0410-83d8-924469b57eb5

blootbot/src/modules.pl

index 746de958cf9218959fdea5e2c6fec87a32747a78..9c49f56c494c3c47cd3479b0f209635fbb5ccec8 100644 (file)
@@ -193,7 +193,7 @@ sub reloadModule {
     my $file   = (grep /\/$mod/, keys %INC)[0];
 
     if (!defined $file) {
-       &WARN("rM: Cannot reload $mod ($file) since it was not loaded anyway.");
+       &WARN("rM: Cannot reload $mod since it was not loaded anyway.");
        return;
     }
 
@@ -205,12 +205,23 @@ sub reloadModule {
     my $age = (stat $file)[9];
     return if ($age == $moduleAge{$file});
 
+    if ($age < $moduleAge{$file}) {
+       &WARN("rM: we're not gonna downgrade the file. use 'touch'.");
+       return;
+    }
+
     if (grep /$mod/, @myModulesReloadNot) {
        &DEBUG("rM: SHOULD NOT RELOAD $mod!!!");
        return;
     }
 
+    my $dc  = &Time2String($age   - $moduleAge{$file});
+    my $ago = &Time2String(time() - $moduleAge{$file});
+
     &status("Module: Loading $mod...");
+    &VERB("Module:  delta change: $dc",2);
+    &VERB("Module:           ago: $ago",2);
+
     delete $INC{$file};
     eval "require \"$file\"";  # require or use?
     if (@$) {