mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2025-08-18 12:45:36 +00:00
possibly fix recurring backend timeout
This commit is contained in:
parent
a78f65b274
commit
e2a45601b3
@ -34,7 +34,7 @@ std::string GenerateCall() {
|
||||
return Ret.str();
|
||||
}
|
||||
std::string RunPromise(const std::string& IP, const std::string& R) {
|
||||
std::packaged_task<std::string()> task([&]() { return PostHTTP(IP, R); });
|
||||
std::packaged_task<std::string()> task([&] { return PostHTTP(IP, R); });
|
||||
std::future<std::string> f1 = task.get_future();
|
||||
std::thread t(std::move(task));
|
||||
t.detach();
|
||||
|
@ -43,6 +43,7 @@ std::string PostHTTP(const std::string& IP, const std::string& Fields) {
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
|
||||
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5);
|
||||
res = curl_easy_perform(curl);
|
||||
curl_easy_cleanup(curl);
|
||||
if (res != CURLE_OK)
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include <mutex>
|
||||
#include <sstream>
|
||||
#include <thread>
|
||||
#include <unistd.h>
|
||||
#include <unordered_map>
|
||||
|
||||
static RWMutex ThreadNameMapMutex;
|
||||
@ -95,7 +94,7 @@ void DebugPrintTIDInternal(const std::string& func, bool overwrite) {
|
||||
#ifdef DEBUG
|
||||
std::scoped_lock Guard(LogLock);
|
||||
std::stringstream Print;
|
||||
Print << "(debug build) Thread '" << std::this_thread::get_id() << "' / '" << gettid() << "' is " << func << "\n";
|
||||
Print << "(debug build) Thread '" << std::this_thread::get_id() << "' is " << func << "\n";
|
||||
ConsoleOut(Print.str());
|
||||
#endif // DEBUG
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user