]> git.donarmstrong.com Git - infobot.git/commitdiff
isStale is basically used by Debian.pl and we were using age in terms of
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sat, 7 Apr 2001 15:59:17 +0000 (15:59 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sat, 7 Apr 2001 15:59:17 +0000 (15:59 +0000)
seconds but the actual function was assuming it was in days - fixed.

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@435 c11ca15a-4712-0410-83d8-924469b57eb5

src/Misc.pl

index 1a216c6ce88284a15c2449a4fea43b9b6c967ec2..be5e034a0343c3c6e715591e36101bfd52f71efb 100644 (file)
@@ -449,10 +449,12 @@ sub isStale {
 
     return 1 unless ( -f $file);
     if ($file =~ /idx/) {
-       my $age = time() - (stat($file))[9];
-       &DEBUG("stale: $age. (". &Time2String($age) .")");
+       my $age2 = time() - (stat($file))[9];
+       &DEBUG("stale: $age2. (". &Time2String($age2) .")");
     }
-    return 1 if (time() - (stat($file))[9] > $age*60*60*24);
+    $age *= 60*60*24 if ($age >= 0 and $age < 30);
+
+    return 1 if (time() - (stat($file))[9] > $age);
     return 0;
 }