Skip to content

Commit

Permalink
fix: wait before sending request
Browse files Browse the repository at this point in the history
  • Loading branch information
akiver committed Feb 8, 2024
1 parent b85deb2 commit f387a18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ If you want to generate an Xcode project `cmake -G Xcode`.

### Linux

1. `sudo apt install build-essential autoconf gcc gcc-multilib g++-multilib libtool`
1. `sudo apt install build-essential autoconf gcc gcc-multilib g++-multilib libtool cmake`
2. Install protobuf - from the root folder run:
1. `cd protobuf`
2. `./autogen.sh`
Expand Down
5 changes: 4 additions & 1 deletion boiler-writter/CSGOMatchList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ void CSGOMatchList::Refresh()
void CSGOMatchList::RefreshWait()
{
m_updateComplete = false;
Refresh();
std::unique_lock<std::mutex> lock(m_matchMutex);
// wait a bit before sending the refreshing otherwise we may not get the response
m_updateCv.wait_for(lock, std::chrono::seconds(1));
Refresh();

std::cv_status status = m_updateCv.wait_for(lock, std::chrono::seconds(10));
if (status == std::cv_status::timeout) {
throw BoilerException(BoilerExitCode::AlreadyConnectedToGC, "Already connected to GC, matches can't be received");
Expand Down

0 comments on commit f387a18

Please sign in to comment.