Skip to content

Commit

Permalink
fix: increase timeout for gen_top_tags_per_country.pl - fixes #6244 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanegigandet authored Jan 5, 2022
1 parent 9108014 commit 35d4d24
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/gen_top_tags_per_country.pl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
use Modern::Perl '2017';
use utf8;

use CGI::Carp qw(fatalsToBrowser);

use ProductOpener::Config qw/:all/;
use ProductOpener::Store qw/:all/;
use ProductOpener::Index qw/:all/;
Expand Down Expand Up @@ -150,7 +148,12 @@

# Sort by created_t so that we can see which product was the nth in each country -> necessary to compute points for Open Food Hunt
# do not include empty products and products that have been marked as obsolete
my $cursor = get_products_collection()->query({'empty' => { "\$ne" => 1 }, 'obsolete' => { "\$ne" => 1 }})->sort({created_t => 1})->fields($fields_ref);

# 300 000 ms timeout so that we can export the whole database
# 5mins is not enough, 50k docs were exported
my $cursor = get_products_collection(3 * 60 * 60 * 1000)->query({'empty' => { "\$ne" => 1 }, 'obsolete' => { "\$ne" => 1 }})->sort({created_t => 1})->fields($fields_ref);

$cursor->immortal(1);

my %products_nutriments = ();
my %countries_categories = ();
Expand Down

0 comments on commit 35d4d24

Please sign in to comment.