WANG 5 år sedan
förälder
incheckning
2c9966fe75

+ 5 - 0
examcloud-core-oe-face-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/face/service/impl/BaiduFaceLivenessWorker.java

@@ -1,11 +1,14 @@
 package cn.com.qmth.examcloud.core.oe.student.face.service.impl;
 
+import java.util.concurrent.TimeUnit;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.commons.helpers.concurrency.simple.Worker;
 import cn.com.qmth.examcloud.commons.helpers.concurrency.simple.WorkerController;
+import cn.com.qmth.examcloud.commons.util.Util;
 import cn.com.qmth.examcloud.core.oe.common.base.Constants;
 import cn.com.qmth.examcloud.core.oe.common.entity.ExamCaptureQueueEntity;
 import cn.com.qmth.examcloud.core.oe.student.face.service.ExamCaptureService;
@@ -42,12 +45,14 @@ public class BaiduFaceLivenessWorker implements Worker<ExamCaptureQueueEntity> {
 				ExamCaptureProcessStatisticController.increaseFaceLivenessDetectCount();
 				captureLog.error("[BAIDU_FACELIVENESS_WORKER.] 自定义异常 " + e.getDesc(), e);
 			}
+			Util.sleep(TimeUnit.MICROSECONDS, 50);
 		} catch (Exception e) {
 			ExamCaptureProcessStatisticController.increaseFaceLivenessDetectCount();
 			// 异常处理
 			element.setErrorMsg(e.getMessage());
 			examCaptureService.disposeBaiDuFaceLivenessFaild(element);
 			captureLog.error("[BAIDU_FACELIVENESS_WORKER.] 系统异常 " + e.getMessage(), e);
+			Util.sleep(TimeUnit.MICROSECONDS, 50);
 		}
 	}
 }

+ 6 - 0
examcloud-core-oe-face-service/src/main/java/cn/com/qmth/examcloud/core/oe/student/face/service/impl/FacePPCompareWorker.java

@@ -1,11 +1,14 @@
 package cn.com.qmth.examcloud.core.oe.student.face.service.impl;
 
+import java.util.concurrent.TimeUnit;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.commons.helpers.concurrency.simple.Worker;
 import cn.com.qmth.examcloud.commons.helpers.concurrency.simple.WorkerController;
+import cn.com.qmth.examcloud.commons.util.Util;
 import cn.com.qmth.examcloud.core.oe.common.base.Constants;
 import cn.com.qmth.examcloud.core.oe.common.entity.ExamCaptureQueueEntity;
 import cn.com.qmth.examcloud.core.oe.student.face.service.ExamCaptureService;
@@ -42,12 +45,15 @@ public class FacePPCompareWorker implements Worker<ExamCaptureQueueEntity> {
 				ExamCaptureProcessStatisticController.increaseFaceCompareFailedCount();
 				captureLog.error("[FACEPP_COMPARE_WORKER.] 自定义异常 " + e.getDesc(), e);
 			}
+
+			Util.sleep(TimeUnit.MICROSECONDS, 50);
 		} catch (Exception e) {
 			ExamCaptureProcessStatisticController.increaseFaceCompareFailedCount();
 			// 异常处理
 			element.setErrorMsg(e.getMessage());
 			examCaptureService.disposeFaceCompareFaild(element);
 			captureLog.error("[FACEPP_COMPARE_WORKER.] 系统异常 " + e.getMessage(), e);
+			Util.sleep(TimeUnit.MICROSECONDS, 50);
 		}
 	}
 }