Commit 4fd34ec0 by WangJinfeng

update sleep 120s

parent d3078074
...@@ -182,7 +182,7 @@ public class ServerUtil { ...@@ -182,7 +182,7 @@ public class ServerUtil {
public static JSONObject upload(JSONArray requestBody) { public static JSONObject upload(JSONArray requestBody) {
logger.info("requestBody -->> " + requestBody); logger.info("requestBody upload -->> " + requestBody);
CloseableHttpClient client = HttpClients.createDefault(); CloseableHttpClient client = HttpClients.createDefault();
RequestConfig requestConfig = RequestConfig.custom() RequestConfig requestConfig = RequestConfig.custom()
...@@ -216,7 +216,7 @@ public class ServerUtil { ...@@ -216,7 +216,7 @@ public class ServerUtil {
public static JSONObject update(JSONArray requestBody) { public static JSONObject update(JSONArray requestBody) {
logger.info("requestBody -->> " + requestBody); logger.info("requestBody update -->> " + requestBody);
CloseableHttpClient client = HttpClients.createDefault(); CloseableHttpClient client = HttpClients.createDefault();
RequestConfig requestConfig = RequestConfig.custom() RequestConfig requestConfig = RequestConfig.custom()
...@@ -240,21 +240,7 @@ public class ServerUtil { ...@@ -240,21 +240,7 @@ public class ServerUtil {
} }
jsonObject = JSON.parseObject(result.toString()); jsonObject = JSON.parseObject(result.toString());
} catch (IOException e) { } catch (IOException e) {
try { logger.info("IOException -->> " + e.getMessage());
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());
}
} finally { } finally {
post.abort(); post.abort();
} }
...@@ -297,7 +283,7 @@ public class ServerUtil { ...@@ -297,7 +283,7 @@ public class ServerUtil {
result.append(line); result.append(line);
} }
JSONObject jsonObject = Constants.String2JSONObject(result.toString()); 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"); audienceId = jsonObject.getIntValue("id");
} }
} catch (IOException e) { } 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