Merge pull request #116 from AleksanderZdunek/master
Fix HttpServer::init() erroneous return value
This commit is contained in:
commit
461c007a04
@ -351,11 +351,12 @@ bool HttpServer::init() {
|
|||||||
httplib::Client cli(config_->get_ip_addr_str().c_str(),
|
httplib::Client cli(config_->get_ip_addr_str().c_str(),
|
||||||
config_->get_http_port());
|
config_->get_http_port());
|
||||||
int retry = 3;
|
int retry = 3;
|
||||||
while (retry--) {
|
while (retry) {
|
||||||
auto res = cli.Get("/api/config");
|
auto res = cli.Get("/api/config");
|
||||||
if (res && res->status == 200) {
|
if (res && res->status == 200) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
--retry;
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
}
|
}
|
||||||
return retry;
|
return retry;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user