From 0cf5a2b8c596060787bf5ab03452926e81053283 Mon Sep 17 00:00:00 2001 From: Florent Date: Tue, 13 Mar 2012 17:14:04 +0100 Subject: [PATCH] Fix refresh of cache in case of empty file --- contrib/freemobile-munin | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contrib/freemobile-munin b/contrib/freemobile-munin index 0dc16ed4..550a8b07 100755 --- a/contrib/freemobile-munin +++ b/contrib/freemobile-munin @@ -110,6 +110,7 @@ if ($ARGV[0] and $ARGV[0] eq "config") { } } else { + my $refresh; my $first = 1; my $time = time(); # Check if cache exist and not older than 3 hours @@ -118,9 +119,12 @@ else { LOOP: while() { if ($first) { if ($time - $_ > $refreshtime) { - $cache = 0; + $refresh = 0; last; } + else { + $refresh = 1; + } $first = 0; } else { @@ -129,7 +133,7 @@ else { } } close(CACHE); - exit if $cache; + exit if $cache and $refresh; # Open cache for writing and execute weboob open(CACHE, "> " . $cachefile) or die "Failed to open file $cachefile";