Adding a limit of requests.
This commit is contained in:
parent
1117f6d52f
commit
8d685edec1
1
Build.PL
1
Build.PL
|
@ -19,6 +19,7 @@ my $build = Module::Build->new(
|
|||
'Image::PNG::Libpng' => 0,
|
||||
'YAML::PP' => 0,
|
||||
'DateTime' => 0,
|
||||
'Mojo::UserAgent::Role::Queued' => 0,
|
||||
},
|
||||
);
|
||||
$build->create_build_script;
|
||||
|
|
|
@ -25,7 +25,10 @@ has last_invalid_card => (
|
|||
has _ua => ( is => 'lazy', );
|
||||
|
||||
sub _build__ua {
|
||||
return Mojo::UserAgent->new;
|
||||
my $ua = Mojo::UserAgent->new->with_roles('+Queued');
|
||||
$ua->max_active(5);
|
||||
$ua->inactivity_timeout(60);
|
||||
return $ua;
|
||||
}
|
||||
|
||||
our $ERR_TOO_MANY_CARDS = 'TOO_MANY_CARDS';
|
||||
|
|
|
@ -156,7 +156,8 @@ sub _pdf_builder {
|
|||
}
|
||||
|
||||
sub _build__ua ($self) {
|
||||
my $ua = Mojo::UserAgent->new;
|
||||
my $ua = Mojo::UserAgent->new->with_roles('+Queued');
|
||||
$ua->max_active(5);
|
||||
$ua->inactivity_timeout(60);
|
||||
return $ua;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue