Throttle Twitch API access for at least 1 second
Some checks failed
debian-build / build (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled

This commit is contained in:
WarmUpTill 2025-11-30 12:23:29 +01:00 committed by WarmUpTill
parent a0e6e6f528
commit e29060fdea

View File

@ -144,9 +144,14 @@ static void handleThrottling(const httplib::Result &response)
return;
}
blog(LOG_WARNING, "Twitch API access is throttled for %lld seconds!",
if (sleepDuration < std::chrono::seconds(1)) {
sleepDuration = std::chrono::seconds(1);
}
blog(LOG_WARNING,
"Twitch API access is throttled for %lld milliseconds!",
static_cast<long long int>(
std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::duration_cast<std::chrono::milliseconds>(
sleepDuration)
.count()));
apiIsThrottling = true;