瀏覽代碼

人体抠图增加休眠1秒

dsx 2 年之前
父節點
當前提交
100fe97a89
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/main/java/com/fdkankan/scene/service/impl/SceneServiceImpl.java

+ 7 - 0
src/main/java/com/fdkankan/scene/service/impl/SceneServiceImpl.java

@@ -112,6 +112,13 @@ public class SceneServiceImpl implements ISceneService {
             log.error("提取人体分割图片失败,imgUrl: "+imgUrl, e);
             log.error("提取人体分割图片失败,imgUrl: "+imgUrl, e);
             bodySegmentStatusBean.setStatus(CommonOperStatus.FAILD.code());
             bodySegmentStatusBean.setStatus(CommonOperStatus.FAILD.code());
             redisUtil.hset(RedisKey.SCENE_BODY_SEGMENT, uuid, JSON.toJSONString(bodySegmentStatusBean));
             redisUtil.hset(RedisKey.SCENE_BODY_SEGMENT, uuid, JSON.toJSONString(bodySegmentStatusBean));
+        }finally {
+            try {
+                //免费版qps不能大于2,故休眠一秒
+                Thread.sleep(1000L);
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
         }
         }
     }
     }