summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Smokeping.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index 6df240b..641c651 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -735,9 +735,9 @@ sub get_detail ($$$$){
} else {
mkdir $cfg->{General}{imgcache}."/__navcache",0755 unless -d $cfg->{General}{imgcache}."/__navcache";
# remove old images after one hour
- my $pattern = "$cfg->{General}{imgcache}/__navcache/*.png";
- for (<"$pattern">){
- unlink $_ if -A $_ > 1/24;
+ my $pattern = $cfg->{General}{imgcache}."/__navcache/*.png";
+ for (glob $pattern){
+ unlink $_ if time - (stat $_)[9] > 3600;
}
$imgbase =$cfg->{General}{imgcache}."/__navcache/".time()."$$";
$imghref =$cfg->{General}{imgurl}."/__navcache/".time()."$$";