Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: increase timeout for gen_top_tags_per_country.pl #6246

Merged
merged 1 commit into from
Jan 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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