X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=loop.pl;h=bb28f1843e7372b2164aa90c7427ab2ae32b3b2f;hb=feceb0bda28cea09e43b9497e38510ef404d5c4a;hp=1fb8998e2361a4a1f8a3f43c7925648fb4c61586;hpb=636f61639c1bfc1ad597c3f2f9f025a84b0405cd;p=dweather.git 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";