diff options
author | Kent Fredric <kentfredric@gmail.com> | 2012-04-10 03:29:26 +1200 |
---|---|---|
committer | Kent Fredric <kentfredric@gmail.com> | 2012-04-10 03:29:26 +1200 |
commit | 7263e878fa21e0e29186e1586f2dd3fd255d1e3d (patch) | |
tree | a06eeb1fc65849a837f2fa82832b7e156d2c5ef8 /scripts | |
parent | [metadata] move metadata/perl to its own repository as a submodule, letting p... (diff) | |
download | perl-overlay-7263e878fa21e0e29186e1586f2dd3fd255d1e3d.tar.gz perl-overlay-7263e878fa21e0e29186e1586f2dd3fd255d1e3d.tar.bz2 perl-overlay-7263e878fa21e0e29186e1586f2dd3fd255d1e3d.zip |
[scripts] Turn on GZIP encoding to make package_map_all faster
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/package_map_all.pl | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/package_map_all.pl b/scripts/package_map_all.pl index a22355be2..8b37bd29a 100755 --- a/scripts/package_map_all.pl +++ b/scripts/package_map_all.pl @@ -33,8 +33,6 @@ my $size = 300; my $metadata = $root->subdir( 'metadata', 'perl' ); my $distmap = $metadata->subdir('distmap'); -#my $distinfo = $metadata->subdir('distinfo'); -$distinfo->mkpath(); my (@json_files) = grep { not $_->is_dir and $_->basename =~ /\.json$/ } $distmap->children(); use JSON; @@ -90,7 +88,10 @@ $ENV{WWW_MECH_NOCACHE} = 1; my $results_string = mcpan->ua->request( 'POST', mcpan->base_url . 'release/_search?search_type=scan&scroll=30s&size=' . $size, - { content => $encoder->encode($search), } + { + headers => { 'Accept-Encoding' => 'gzip', }, + content => $encoder->encode($search), + } ); say $results_string->{content}; @@ -125,8 +126,11 @@ exit 0; sub scroll { my ($id) = @_; - my $result = - mcpan->ua->request( 'GET', 'http://api.metacpan.org/_search/scroll/?scroll=30s&size=' . $size . '&scroll_id=' . $id ); + my $result = mcpan->ua->request( + 'GET', + 'http://api.metacpan.org/_search/scroll/?scroll=30s&size=' . $size . '&scroll_id=' . $id, + { headers => { 'Accept-Encoding' => 'gzip', } } + ); my $data = $decoder->decode( $result->{content} ); return $data, $data->{_scroll_id}; |