Browse Source

优化百度和face++代码

lideyin 5 years ago
parent
commit
046fbf4005

+ 10 - 10
examcloud-core-oe-face-starter/src/main/java/cn/com/qmth/examcloud/core/oe/student/face/starter/config/ProcessPhotoAlarmTask.java

@@ -39,8 +39,8 @@ public class ProcessPhotoAlarmTask implements ApplicationRunner {
 
     @Override
     public void run(ApplicationArguments args) throws Exception {
-        new Thread(() -> {
-            faceCompareAlarm();
+                new Thread(() -> {
+                    faceCompareAlarm();
         }).start();
         new Thread(() -> {
             faceLivenessDectectAlarm();
@@ -52,11 +52,11 @@ public class ProcessPhotoAlarmTask implements ApplicationRunner {
      */
     private void faceCompareAlarm() {
         while (true) {
-            if (captureLog.isDebugEnabled()){
+//            if (captureLog.isDebugEnabled()){
                 captureLog.debug("[FACE_COMPARE_ALARM] 进入人脸" + System.currentTimeMillis() + "....totalCount=" +
                         ExamCaptureProcessStatisticController.getFaceCompareCount() + " ,failCount=" +
                         ExamCaptureProcessStatisticController.getFaceCompareFailedCount());
-            }
+//            }
 
             //如果每分钟失败率超过50%则发短信报警,且总数不少于10次则短信报警
             if (ExamCaptureProcessStatisticController.getFaceCompareCount() > COUNT_WARN_THRESHOLD &&
@@ -64,16 +64,16 @@ public class ProcessPhotoAlarmTask implements ApplicationRunner {
                 SysPropertyCacheBean faceCompareSmsAssemblyCodeProperty = CacheHelper.getSysProperty("capture.faceCompare.smsAssemblyCode");
 
                 if (!faceCompareSmsAssemblyCodeProperty.getHasValue()) {
-                    if (captureLog.isErrorEnabled()){
+//                    if (captureLog.isErrorEnabled()){
                         captureLog.error("[FACE_COMPARE_ALARM.] 未配置人脸比对的短信模板代码,totalCount="+ExamCaptureProcessStatisticController.getFaceCompareCount()+",errorCount="+ExamCaptureProcessStatisticController.getFaceCompareFailedCount());
-                    }
+//                    }
                     throw new StatusException("300001", "未配置人脸比对的短信模板代码");
                 }
                 SysPropertyCacheBean smsPhoneProperty = CacheHelper.getSysProperty("capture.sms.phones");
                 if (!smsPhoneProperty.getHasValue()) {
-                    if (captureLog.isErrorEnabled()){
+//                    if (captureLog.isErrorEnabled()){
                         captureLog.error("[FACE_COMPARE_ALARM.] 未配置图片处理失败的通知手机号,totalCount="+ExamCaptureProcessStatisticController.getFaceCompareCount()+",errorCount="+ExamCaptureProcessStatisticController.getFaceCompareFailedCount());
-                    }
+//                    }
                     throw new StatusException("300002", "未配置图片处理失败的通知手机号");
                 }
 
@@ -89,9 +89,9 @@ public class ProcessPhotoAlarmTask implements ApplicationRunner {
                 params.put("errorCount", String.valueOf(ExamCaptureProcessStatisticController.getFaceCompareFailedCount()));
                 sendSmsReq.setParams(params);
                 try {
-                    if (captureLog.isDebugEnabled()){
+//                    if (captureLog.isDebugEnabled()){
                         captureLog.debug("[FACE_COMPARE_ALARM.] 开始调用发送短信接口,totalCount="+ExamCaptureProcessStatisticController.getFaceCompareCount()+",errorCount="+ExamCaptureProcessStatisticController.getFaceCompareFailedCount());
-                    }
+//                    }
                     smsCloudService.sendSms(sendSmsReq);
                 } catch (Exception e) {
                     captureLog.error("[FACE_COMPARE_ALARM.] 发送短信出现异常", e);