Unverified Commit d5bdc47e authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

generate_missing_stats: also rebuild yearly stats, if needed

parent 10342143
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1174,6 +1174,8 @@ sub generate_missing_stats {

	my $stats_index = 0;

	my %need_year;

	for my $journey_index ( 0 .. $#journey_months ) {
		if (    $stats_index < @stats_months
			and $journey_months[$journey_index][0]
@@ -1185,6 +1187,7 @@ sub generate_missing_stats {
		}
		else {
			my ( $year, $month ) = @{ $journey_months[$journey_index] };
			$need_year{$year} = 1;
			$self->get_stats(
				uid        => $uid,
				db         => $db,
@@ -1194,6 +1197,14 @@ sub generate_missing_stats {
			);
		}
	}
	for my $year ( keys %need_year ) {
		$self->get_stats(
			uid        => $uid,
			db         => $db,
			year       => $year,
			write_only => 1
		);
	}
}

sub get_nav_months {