]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Misc.pl
converted %{$blah{$blah}} to %{ $blah{$blah} }
[infobot.git] / src / Misc.pl
index 1a216c6ce88284a15c2449a4fea43b9b6c967ec2..3db0cdce4d6c39adcfd7ee2071c677600bfd08fb 100644 (file)
@@ -208,7 +208,7 @@ sub fixFileList {
     # sort the hash list appropriately.
     foreach (sort keys %files) {
        my $file = $_;
-       my @keys = sort keys %{$files{$file}};
+       my @keys = sort keys %{ $files{$file} };
        my $i    = scalar(@keys);
 
        if ($i > 1) {
@@ -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;
 }