From 3ca78feffa42b2863dcc23c2143d96bead1e107f Mon Sep 17 00:00:00 2001 From: Tobi Oetiker Date: Mon, 4 Jul 2005 05:58:11 +0000 Subject: the old pngs in __navcache did not get removed properly ... --- lib/Smokeping.pm | 6 +++--- 1 file 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()."$$"; -- cgit v1.2.3-24-g4f1b