our $ld = {};
our @last10minsr = ();
our @last5daysh = ();
-our $windmins = 5; # no of minutes of wind data for the windrose
+our $windmins = 2; # no of minutes of wind data for the windrose
our $histdays = 5; # no of days of (half)hour data to search for main graph
+our $updatepermin = 60 / 2.5; # no of updates per minute
our $loop_count; # how many LOOPs we have done, used as start indicator
dbg "before next tick";
Mojo::IOLoop->next_tick(sub { loop() });
dbg "before app start";
+app->secrets([qw(Here's something that's really seakrett)]);
app->start;
dbg "after app start";
} else {
my $o = gen_hash_diff($ld->{last_h}, \%h);
if ($o) {
+ $o->{Dir} ||= $h{Dir};
+ $o->{Wind} ||= $h{Wind};
+ $o->{Dir} += 0;
+ $o->{Wind} += 0;
$s = genstr($ts, 'r', $o);
push @last10minsr, $s;
- shift @last10minsr if @last10minsr > 240;
+ shift @last10minsr while @last10minsr > ($windmins * $updatepermin);
}
else {
dbg "loop rec not changed" if isdbg 'chan';