mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-21 09:37:26 -05:00
Fix thread flood when Twitch event sub connection is lost
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (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
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (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:
parent
d6185a6099
commit
17d9b73b9a
|
|
@ -196,12 +196,12 @@ std::string EventSub::AddEventSubscribtion(std::shared_ptr<TwitchToken> token,
|
|||
return "";
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(eventSub->_subscriptionMtx);
|
||||
std::unique_lock<std::mutex> lock(eventSub->_subscriptionMtx);
|
||||
if (!eventSub->_connected) {
|
||||
std::thread t([eventSub]() { eventSub->Connect(); });
|
||||
t.detach();
|
||||
vblog(LOG_INFO, "Twitch EventSub connect started for %s",
|
||||
token->GetName().c_str());
|
||||
lock.unlock();
|
||||
eventSub->Connect();
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user