Updated “ckrl()” to “ckratelimit.php” “lib” version

This commit is contained in:
pezcurrel 2024-09-28 05:48:45 +02:00
parent 50e8720adb
commit b24ee766bd

View file

@ -56,8 +56,9 @@ token=as7f8a7s0d89f7as97df09a8s7d90f81jkl2h34lkj12h3jkl4
---
Then run {$SCRIPTNAME} with the path of the configuration file you have
created. This will create an «index.html» file that will be ready to be put
where you want (you can also see it locally, obviously).
created as an argument. This will create an «index.html» file in the current
directory, that will be ready to be put where you want (you can also see it
locally, obviously).
[[[ OPTIONS ]]]
@ -407,7 +408,7 @@ function eecho($text) {
function ckrl($headers) {
$rl=ckratelimit($headers);
if ($rl['ok'] && $rl['sleep']>0) {
if ($rl['ok'] && $rl['remaining']==0) {
echo "\rInfo: reached rate limit, sleeping for {$rl['sleep']} second(s)... ";
sleep($rl['sleep']);
echo "\n";