Updated “ckrl()” to the “lib” version

This commit is contained in:
pezcurrel 2024-09-28 05:45:03 +02:00
parent 51b356bf14
commit 20ff553d5c

View file

@ -1206,7 +1206,7 @@ function ckrl($headers,$ctx) {
$res=ckratelimit($headers);
if (!$res['ok']) {
eecho(2,"{$ctx}: ckratelimit: {$res['error']}.\n");
} elseif ($res['sleep']>0) {
} elseif ($res['remaining']==0) {
eecho(2,"{$ctx}: ckratelimit: x-ratelimit-remaining is 0, sleeping for ".ght($res['sleep']).' (until '.date('c',time()+$res['sleep']).") ...\n");
sleep($res['sleep']);
}