Prechádzať zdrojové kódy

智慧交流-车速统计

sixian 2 rokov pred
rodič
commit
435c17f317

+ 3 - 4
app/operation/controller/captureController.go

@@ -174,9 +174,8 @@ func (c captureCtl) OverSpeedRecord(ctx *gin.Context) {
 func (c captureCtl) OverSpeedRecordSync(ctx *gin.Context) {
 	var req model.RequestCaptureFilter
 	_ = ctx.ShouldBindQuery(&req)
-	if err := service.CaptureSpeedService.SyncOverSpeedRecord(req.StartTime, req.EndTime); err != nil {
-		ctx.JSON(http.StatusOK, err)
-		return
-	}
+	go func() {
+		service.CaptureSpeedService.SyncOverSpeedRecord(req.StartTime, req.EndTime)
+	}()
 	ctx.JSON(http.StatusOK, common.SuccessResponse(common.Succeeded, nil))
 }