mirror of
https://github.com/anikeen-com/yaac.git
synced 2026-03-19 00:26:14 +00:00
Only sleep if there is work to do
This commit is contained in:
@@ -296,7 +296,9 @@ class Client
|
|||||||
$this->signPayloadKid(null, $challenge->getAuthorizationURL())
|
$this->signPayloadKid(null, $challenge->getAuthorizationURL())
|
||||||
);
|
);
|
||||||
$data = json_decode((string)$response->getBody(), true);
|
$data = json_decode((string)$response->getBody(), true);
|
||||||
sleep(ceil(15 / $maxAttempts));
|
if ($maxAttempts > 1) {
|
||||||
|
sleep(ceil(15 / $maxAttempts));
|
||||||
|
}
|
||||||
$maxAttempts--;
|
$maxAttempts--;
|
||||||
} while ($maxAttempts > 0 && $data['status'] != 'valid');
|
} while ($maxAttempts > 0 && $data['status'] != 'valid');
|
||||||
|
|
||||||
@@ -441,7 +443,9 @@ class Client
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sleep(ceil(45 / $maxAttempts));
|
if ($maxAttempts > 1) {
|
||||||
|
sleep(ceil(45 / $maxAttempts));
|
||||||
|
}
|
||||||
$maxAttempts--;
|
$maxAttempts--;
|
||||||
} while ($maxAttempts > 0);
|
} while ($maxAttempts > 0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user