diff --git a/lib/MetaCPAN/Web/Model/API.pm b/lib/MetaCPAN/Web/Model/API.pm index 891a4b7e57..24fc67197d 100644 --- a/lib/MetaCPAN/Web/Model/API.pm +++ b/lib/MetaCPAN/Web/Model/API.pm @@ -137,11 +137,13 @@ sub request { ); my $req_p = $self->client->do_request( request => $request ); - $req_p = $req_p->catch( sub { - # retry once - $self->client->do_request( request => $request ); - } ); + # Do not retry - if the API is loaded/slow then this just makes it worse. + # $req_p = $req_p->catch( sub { + + # # retry once + # $self->client->do_request( request => $request ); + # } ); $req_p->transform( done => sub { my $response = shift; diff --git a/t/controller/feed.t b/t/controller/feed.t index d4717ab3cf..580ded89b5 100644 --- a/t/controller/feed.t +++ b/t/controller/feed.t @@ -198,23 +198,24 @@ subtest 'get correct author release data format' => sub { is( $entry->[0]->{author}, 'OALDERS', 'get correct author name' ); }; +## We are not doing retries as if API is loaded we do not want to retry # do this last so the override_api_response only affects this -my $how_many = 0; -override_api_response( - if => sub { !$how_many++ }, # fail only once - sub { Future->fail('Error'); }, -); -test_psgi app, sub { - my $cb = shift; - subtest 'retry on transient failure' => sub { - ok( my $res = $cb->( GET '/recent.rss' ) ); - is( $res->code, 200, 'code 200' ); - is( - $res->header('content-type'), - 'application/rss+xml; charset=UTF-8', - 'Content-type is application/rss+xml' - ); - }; -}; +# my $how_many = 0; +# override_api_response( +# if => sub { !$how_many++ }, # fail only once +# sub { Future->fail('Error'); }, +# ); +# test_psgi app, sub { +# my $cb = shift; +# subtest 'retry on transient failure' => sub { +# ok( my $res = $cb->( GET '/recent.rss' ) ); +# is( $res->code, 200, 'code 200' ); +# is( +# $res->header('content-type'), +# 'application/rss+xml; charset=UTF-8', +# 'Content-type is application/rss+xml' +# ); +# }; +# }; done_testing;