(plugin) network::cisco::meraki::cloudcontroller::restapi - handle limit gracefully (#3919)
This commit is contained in:
parent
32e8712aa5
commit
e4c7f13446
|
@ -189,7 +189,9 @@ sub request_api {
|
|||
return undef if (defined($options{ignore_codes}) && defined($options{ignore_codes}->{$code}));
|
||||
|
||||
if ($code == 429) {
|
||||
sleep(1);
|
||||
my ($retry) = $self->{http}->get_header(name => 'Retry-After');
|
||||
$retry = defined($retry) && $retry =~ /^\s*(\d+)\s*/ ? $retry : 1;
|
||||
sleep($retry);
|
||||
next;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue