瀏覽代碼

请求增加休眠时间,避免频繁请求

xiewenjie 3 年之前
父節點
當前提交
79bb9968b4
共有 1 個文件被更改,包括 4 次插入5 次删除
  1. 4 5
      sxz-core/src/main/java/com/fdkk/sxz/other/listener/RunBuild.java

+ 4 - 5
sxz-core/src/main/java/com/fdkk/sxz/other/listener/RunBuild.java

@@ -332,6 +332,7 @@ public class RunBuild {
             int times = 0;
             while (true) {
                 String checkResult = OkHttpUtils.httpPostJson(buildUrl + "check", jsonObject.toJSONString());
+                Thread.sleep(2000L);
                 JSONObject checkJson = JSONObject.parseObject(checkResult);
 
                 RunBuild.log.info("vrnum-{}, 请求检查3d场景渲染接口获取接口数据-{}", vrNum, checkJson);
@@ -375,9 +376,6 @@ public class RunBuild {
                         updateSceneStyleEntity.setUpdateTime(new Date());
                         sceneStyleService.updateById(updateSceneStyleEntity);
                     }
-                    if (times > 500) {
-                        throw new RuntimeException("渲染次数大于500次,直接宣定报错");
-                    }
                 }
 
                 if (over) {
@@ -442,6 +440,7 @@ public class RunBuild {
             //将所有该场景码的图片设置为不是封面图
             sceneLightService.updateIsCoverBySceneStyleId(sceneStyleEntity.getId());
         } catch (Exception e) {
+            e.printStackTrace();
             updateSceneStyleEntity.setStatus(-1);
             updateSceneStyleEntity.setUpdateTime(new Date());
             sceneStyleService.updateById(updateSceneStyleEntity);
@@ -453,9 +452,9 @@ public class RunBuild {
                 OkHttpUtils.httpPostForm(mainUrl + "api/scene/updateStatusByScene", map1);
                 RunBuild.log.info("计算失败--修改场景状态完成");
             } catch (Exception ex) {
-                RunBuild.log.error("渲染失败-{}", e);
+                RunBuild.log.error("渲染失败请求-{}", e.getMessage());
             }
-            RunBuild.log.error("渲染失败-{}", e);
+            RunBuild.log.error("渲染失败-{}", e.getMessage());
         }
     }