mirror of
https://github.com/Relintai/wp_saver_rcpp_fw.git
synced 2024-11-18 09:07:21 +01:00
Fix crash on startup.
This commit is contained in:
parent
4c4207a4d2
commit
818f5be1e9
6
main.cpp
6
main.cpp
@ -112,13 +112,17 @@ void download_posts(Database *db, const String &site) {
|
||||
trantor::EventLoop *loop;
|
||||
std::thread t([&loop]() { loop = new trantor::EventLoop(); loop->loop(); delete loop; loop = nullptr; });
|
||||
|
||||
while (loop == nullptr) {
|
||||
//todo sleep
|
||||
}
|
||||
|
||||
HttpClientPtr http_client = drogon::HttpClient::newHttpClient("http://127.0.0.1:8080/", loop);
|
||||
|
||||
HttpRequestPtr request = drogon::HttpRequest::newHttpRequest();
|
||||
request->setMethod(drogon::HttpMethod::Get);
|
||||
request->setPath(last_url);
|
||||
|
||||
http_client->sendRequest(request);
|
||||
http_client->sendRequest(request, [](ReqResult res, const HttpResponsePtr &resptr){ RLOG_ERR("test\n"); });
|
||||
|
||||
while (true) {
|
||||
//todo remove
|
||||
|
Loading…
Reference in New Issue
Block a user