From: Dirk Koopman Date: Tue, 27 Jan 2015 11:49:21 +0000 (+0000) Subject: restore data saving X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=feceb0bda28cea09e43b9497e38510ef404d5c4a;p=dweather.git restore data saving --- diff --git a/loop.pl b/loop.pl index 1fb8998..bb28f18 100755 --- a/loop.pl +++ b/loop.pl @@ -157,6 +157,8 @@ dbg "after app start"; write_ld(); $dataf->close if $dataf; +undef $dataf; + # move all the files along one cycle_loop_data_files(); @@ -534,7 +536,7 @@ sub gen_hash_diff my $count; while (my ($k, $v) = each %$now) { - if ($last->{$k} ne $now->{$k}) { + if (!exists $last->{$k} || $last->{$k} ne $now->{$k}) { $o{$k} = $v; ++$count; } @@ -698,6 +700,7 @@ sub write_ld sub cycle_loop_data_files { $dataf->close if $dataf; + undef $dataf; rename "$datafn.oooo", "$datafn.ooooo"; rename "$datafn.ooo", "$datafn.oooo";