Roc 1 рік тому
батько
коміт
51d7266c81
1 змінених файлів з 6 додано та 1 видалено
  1. 6 1
      services/task.go

+ 6 - 1
services/task.go

@@ -32,6 +32,7 @@ func AutoUpdateUserView() {
 			var userViewRedisData cache.UserViewRedisData
 			utils.FileLog.Info("redis:" + string(b))
 			if err := json.Unmarshal(b, &userViewRedisData); err != nil {
+				fmt.Println(utils.APPNAME + " " + utils.RunMode + " 失败提醒:" + fmt.Sprint("AutoUpdateUserView ERR:", err, ";response data:", string(b)))
 				go alarm_msg.SendAlarmMsg(utils.APPNAME+" "+utils.RunMode+" 失败提醒:"+fmt.Sprint("AutoUpdateUserView ERR:", err, ";response data:", string(b)), 2)
 				//}
 				//if _, err := models.AddLogs(&log); err != nil {
@@ -40,6 +41,7 @@ func AutoUpdateUserView() {
 				// 客户的阅读时间
 				err = models.UpdateCompanyProductViewData(userViewRedisData.CompanyId, userViewRedisData.ProductId, userViewRedisData.ViewTime)
 				if err != nil {
+					fmt.Println(utils.APPNAME + " " + utils.RunMode + " 失败提醒:" + fmt.Sprint("AutoUpdateUserView Update UpdateCompanyProductViewData ERR:", err, ";response data:", string(b)))
 					go alarm_msg.SendAlarmMsg(utils.APPNAME+" "+utils.RunMode+" 失败提醒:"+fmt.Sprint("AutoUpdateUserView Update UpdateCompanyProductViewData ERR:", err, ";response data:", string(b)), 2)
 				}
 
@@ -69,10 +71,12 @@ func AutoUpdateUserView() {
 					}
 					viewTime, tmpErr := time.ParseInLocation(utils.FormatDateTime, userViewRedisData.ViewTime, time.Local)
 					if tmpErr != nil {
-						go utils.SendEmail(utils.APPNAME+" "+utils.RunMode+" 失败提醒", fmt.Sprint("AutoUpdateUserView ADD UserReportViewRecord ERR:", err, ";response data:", string(b)), utils.EmailSendToUsers)
+						fmt.Println(utils.APPNAME+" "+utils.RunMode+" 失败提醒", fmt.Sprint("AutoUpdateUserView ADD UserReportViewRecord ERR:", tmpErr, ";response data:", string(b)))
+						go utils.SendEmail(utils.APPNAME+" "+utils.RunMode+" 失败提醒", fmt.Sprint("AutoUpdateUserView ADD UserReportViewRecord ERR:", tmpErr, ";response data:", string(b)), utils.EmailSendToUsers)
 					} else {
 						err = item.Insert(viewTime.Year(), item)
 						if err != nil {
+							fmt.Println(utils.APPNAME+" "+utils.RunMode+" 失败提醒", fmt.Sprint("AutoUpdateUserView ADD UserReportViewRecord ERR:", err, ";response data:", string(b)))
 							go utils.SendEmail(utils.APPNAME+" "+utils.RunMode+" 失败提醒", fmt.Sprint("AutoUpdateUserView ADD UserReportViewRecord ERR:", err, ";response data:", string(b)), utils.EmailSendToUsers)
 						}
 					}
@@ -81,6 +85,7 @@ func AutoUpdateUserView() {
 				// 联系人的阅读时间
 				err = models.UpdateWxUserViewData(userViewRedisData.UserId, userViewRedisData.ProductId, userViewRedisData.ViewTime)
 				if err != nil {
+					fmt.Println(utils.APPNAME + " " + utils.RunMode + " 失败提醒:" + fmt.Sprint("AutoUpdateUserView Update UpdateWxUserViewData ERR:", err, ";response data:", string(b)))
 					go alarm_msg.SendAlarmMsg(utils.APPNAME+" "+utils.RunMode+" 失败提醒:"+fmt.Sprint("AutoUpdateUserView Update UpdateWxUserViewData ERR:", err, ";response data:", string(b)), 2)
 				}
 			}