summaryrefslogtreecommitdiffstats
path: root/lib/Smokeping
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2007-08-21 21:36:35 +0200
committerTobi Oetiker <tobi@oetiker.ch>2007-08-21 21:36:35 +0200
commita7516a949c37dca39141dee7baeb72b01f262b29 (patch)
tree4158d012f0cdf59620823c7f10bafa21ff9e888c /lib/Smokeping
parent4909ade650a31797ee4d305565a91061e8a5b812 (diff)
downloadsmokeping-a7516a949c37dca39141dee7baeb72b01f262b29.tar.gz
smokeping-a7516a949c37dca39141dee7baeb72b01f262b29.tar.xz
remove cache after reading it
Diffstat (limited to 'lib/Smokeping')
-rw-r--r--lib/Smokeping/Slave.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Smokeping/Slave.pm b/lib/Smokeping/Slave.pm
index e5ddb5d..6b693cb 100644
--- a/lib/Smokeping/Slave.pm
+++ b/lib/Smokeping/Slave.pm
@@ -64,10 +64,11 @@ sub submit_results {
my $store = $slave_cfg->{cache_dir}."/data";
$store .= "_$myprobe" if $myprobe;
$store .= ".cache";
- my $restore = retrieve $store if -f $store;
+ my $restore = -f $store ? retrieve $store : [];
+ unlink $store;
my $data = get_results($slave_cfg, $cfg, $probes, $cfg->{Targets}, '', $myprobe);
- push @$data, @$restore if $restore;
- my $data_dump = join("\n",@{$data}) || "";
+ push @$restore, @$data;
+ my $data_dump = join("\n",@{$restore}) || "";
my $ua = LWP::UserAgent->new(
agent => 'smokeping-slave/1.0',
timeout => 10,