mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-21 17:34:57 -05:00
Throttle Twitch API access for at least 1 second
This commit is contained in:
parent
a0e6e6f528
commit
e29060fdea
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user