From 2108c7cecdac852e29a5a9a0b606af056f11066c Mon Sep 17 00:00:00 2001 From: dms Date: Fri, 22 Sep 2000 10:48:42 +0000 Subject: [PATCH] verbose on reload (time ago, delta time) git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@120 c11ca15a-4712-0410-83d8-924469b57eb5 --- blootbot/src/modules.pl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/blootbot/src/modules.pl b/blootbot/src/modules.pl index 746de95..9c49f56 100644 --- a/blootbot/src/modules.pl +++ b/blootbot/src/modules.pl @@ -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 (@$) { -- 2.39.2