Skip to content

Commit

Permalink
Remove prefetch for heatmap pin fetching.
Browse files Browse the repository at this point in the history
The prefetch used in the sidebar queries is
not needed when fetching the pin data.
  • Loading branch information
dracos committed Dec 6, 2023
1 parent 7fbc166 commit bf80e88
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions perllib/FixMyStreet/App/Controller/Dashboard.pm
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,9 @@ sub heatmap : Local : Args(0) {
my $parameters = $c->forward( '/reports/load_problems_parameters');

my $where = $parameters->{where};
# Filter includes order_by, rows, and a prefetch entry
my $filter = $parameters->{filter};
# We don't need the rows, as we always want all reports
delete $filter->{rows};

$c->forward('heatmap_filters', [ $where ]);
Expand All @@ -423,6 +425,9 @@ sub heatmap : Local : Args(0) {

if ($c->get_param('ajax')) {
my @pins;
# We don't need any of the prefetched stuff now
delete $filter->{prefetch};
my $problems = $c->cobrand->problems->to_body($body)->search($where, $filter);
while ( my $problem = $problems->next ) {
push @pins, $problem->pin_data('reports');
}
Expand Down

0 comments on commit bf80e88

Please sign in to comment.