Commit 6d4d10ba by “liusq”

循环重试获取远程配置

parent ec4d59c6
......@@ -36,15 +36,19 @@ MainWindow::MainWindow()
findLocalSerialNumber(serialNumber);
qInfo()<<"serialNumber==:"<<serialNumber;
bool configFetched = false;
while (!configFetched) {
HttpService httpService(httpurl);
vides_data::response *res= httpService.httpDeviceConfig(serialNumber,config);
if(res->code!=0){
qInfo()<<"请求远程商户配置失败";
vides_data::response *res = httpService.httpDeviceConfig(serialNumber, config);
if (res->code != 0) {
qInfo() << "请求远程商户配置失败,重试中...";
instace.deleteObj(res);
return ;
}
QThread::sleep(5); // 等待5秒后重试
} else {
instace.deleteObj(res);
configFetched = true;
}
}
initCommon();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment