Explorar o código

fix:增加上海有色爬虫日志

zqbao hai 5 meses
pai
achega
14eaee6fd2
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      services/smm_shanghai.go

+ 7 - 0
services/smm_shanghai.go

@@ -392,6 +392,12 @@ type EdbInfoData struct {
 }
 
 func SyncShangHaiSmm(cont context.Context) (err error) {
+	utils.FileLog.Info("上海有色爬虫开始更新")
+	defer func() {
+		if err := recover(); err != nil {
+			utils.FileLog.Error("上海有色爬虫更新失败:%+v", err)
+		}
+	}()
 	upMonth := time.Now().AddDate(0, -1, 0).Format(utils.FormatDate)
 	curDate := time.Now().Format(utils.FormatDate)
 	reqList := make([]SmmRequest, 0)
@@ -462,6 +468,7 @@ func SyncShangHaiSmm(cont context.Context) (err error) {
 		fmt.Println("上海有色爬虫更新失败")
 		return
 	}
+	utils.FileLog.Info("上海有色爬虫开始更新")
 	return
 }