Commit 4fd34ec0 by WangJinfeng

update sleep 120s

parent d3078074
......@@ -182,7 +182,7 @@ public class ServerUtil {
public static JSONObject upload(JSONArray requestBody) {
logger.info("requestBody -->> " + requestBody);
logger.info("requestBody upload -->> " + requestBody);
CloseableHttpClient client = HttpClients.createDefault();
RequestConfig requestConfig = RequestConfig.custom()
......@@ -216,7 +216,7 @@ public class ServerUtil {
public static JSONObject update(JSONArray requestBody) {
logger.info("requestBody -->> " + requestBody);
logger.info("requestBody update -->> " + requestBody);
CloseableHttpClient client = HttpClients.createDefault();
RequestConfig requestConfig = RequestConfig.custom()
......@@ -240,21 +240,7 @@ public class ServerUtil {
}
jsonObject = JSON.parseObject(result.toString());
} catch (IOException e) {
try {
post.setConfig(requestConfig);
post.setEntity(new StringEntity(requestBody.toJSONString()));
response = client.execute(post);
BufferedReader rd = new BufferedReader(
new InputStreamReader(response.getEntity().getContent()));
StringBuilder result = new StringBuilder();
String line;
while ((line = rd.readLine()) != null) {
result.append(line);
}
jsonObject = JSON.parseObject(result.toString());
} catch (IOException ex) {
logger.info("IOException -->> " + ex.getMessage());
}
logger.info("IOException -->> " + e.getMessage());
} finally {
post.abort();
}
......@@ -297,7 +283,7 @@ public class ServerUtil {
result.append(line);
}
JSONObject jsonObject = Constants.String2JSONObject(result.toString());
if (!jsonObject.isEmpty() && jsonObject.containsKey("id")) {
if (!jsonObject.isEmpty() && jsonObject.containsKey("id") && jsonObject.getString("audience_name").equals(audienceName)) {
audienceId = jsonObject.getIntValue("id");
}
} catch (IOException e) {
......
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