mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-29 16:45:04 +02:00
(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…
x
Reference in New Issue
Block a user