Commit 6d4d10ba by “liusq”

循环重试获取远程配置

parent ec4d59c6
...@@ -36,15 +36,19 @@ MainWindow::MainWindow() ...@@ -36,15 +36,19 @@ MainWindow::MainWindow()
findLocalSerialNumber(serialNumber); findLocalSerialNumber(serialNumber);
qInfo()<<"serialNumber==:"<<serialNumber; qInfo()<<"serialNumber==:"<<serialNumber;
bool configFetched = false;
while (!configFetched) {
HttpService httpService(httpurl); HttpService httpService(httpurl);
vides_data::response *res = httpService.httpDeviceConfig(serialNumber, config);
vides_data::response *res= httpService.httpDeviceConfig(serialNumber,config); if (res->code != 0) {
if(res->code!=0){ qInfo() << "请求远程商户配置失败,重试中...";
qInfo()<<"请求远程商户配置失败";
instace.deleteObj(res); instace.deleteObj(res);
return ; QThread::sleep(5); // 等待5秒后重试
} } else {
instace.deleteObj(res); instace.deleteObj(res);
configFetched = true;
}
}
initCommon(); 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