reduce pubsub/liveupdates pubsub clients "wait for clean exit" time from 1s to 100ms (#6019)
This commit is contained in:
@@ -49,6 +49,7 @@
|
|||||||
- Dev: Updated `googletest` to 1.16.0. (#5942)
|
- Dev: Updated `googletest` to 1.16.0. (#5942)
|
||||||
- Dev: Fixed duplicate CMake configure in clean builds. (#5940)
|
- Dev: Fixed duplicate CMake configure in clean builds. (#5940)
|
||||||
- Dev: BTTV emotes are now loaded as WEBP. (#5957)
|
- Dev: BTTV emotes are now loaded as WEBP. (#5957)
|
||||||
|
- Dev: Reduced time we wait for PubSub connections to cleanly exit from 1s to 100ms. (#6019)
|
||||||
- Dev: Added snapshot tests for EventSub. (#5965)
|
- Dev: Added snapshot tests for EventSub. (#5965)
|
||||||
|
|
||||||
## 2.5.2
|
## 2.5.2
|
||||||
|
|||||||
@@ -159,16 +159,16 @@ public:
|
|||||||
// There is a case where a new client was initiated but not added to the clients list.
|
// There is a case where a new client was initiated but not added to the clients list.
|
||||||
// We just don't join the thread & let the operating system nuke the thread if joining fails
|
// We just don't join the thread & let the operating system nuke the thread if joining fails
|
||||||
// within 1s.
|
// within 1s.
|
||||||
if (this->stoppedFlag_.waitFor(std::chrono::seconds{1}))
|
if (this->stoppedFlag_.waitFor(std::chrono::milliseconds{100}))
|
||||||
{
|
{
|
||||||
this->mainThread_->join();
|
this->mainThread_->join();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
qCWarning(chatterinoLiveupdates)
|
qCWarning(chatterinoLiveupdates)
|
||||||
<< "Thread didn't finish within 1 second, force-stop the client";
|
<< "Thread didn't finish within 100ms, force-stop the client";
|
||||||
this->websocketClient_.stop();
|
this->websocketClient_.stop();
|
||||||
if (this->stoppedFlag_.waitFor(std::chrono::milliseconds{100}))
|
if (this->stoppedFlag_.waitFor(std::chrono::milliseconds{20}))
|
||||||
{
|
{
|
||||||
this->mainThread_->join();
|
this->mainThread_->join();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -596,16 +596,16 @@ void PubSub::stop()
|
|||||||
// within 1s.
|
// within 1s.
|
||||||
// We could fix the underlying bug, but this is easier & we realistically won't use this exact code
|
// We could fix the underlying bug, but this is easier & we realistically won't use this exact code
|
||||||
// for super much longer.
|
// for super much longer.
|
||||||
if (this->stoppedFlag_.waitFor(std::chrono::seconds{1}))
|
if (this->stoppedFlag_.waitFor(std::chrono::milliseconds{100}))
|
||||||
{
|
{
|
||||||
this->thread->join();
|
this->thread->join();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
qCWarning(chatterinoLiveupdates)
|
qCWarning(chatterinoLiveupdates)
|
||||||
<< "Thread didn't finish within 1 second, force-stop the client";
|
<< "Thread didn't finish within 100ms, force-stop the client";
|
||||||
this->websocketClient.stop();
|
this->websocketClient.stop();
|
||||||
if (this->stoppedFlag_.waitFor(std::chrono::milliseconds{100}))
|
if (this->stoppedFlag_.waitFor(std::chrono::milliseconds{20}))
|
||||||
{
|
{
|
||||||
this->thread->join();
|
this->thread->join();
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user