boweniac 2 giorni fa
parent
commit
e2646268c0
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3 3
      crontask/send_wx.go

+ 3 - 3
crontask/send_wx.go

@@ -75,9 +75,6 @@ func (l *CronTask) sendWx() {
 	getServerInfo := func(wxid string) (string, error) {
 		key := "crontask_wx_server_info"
 		val, _ := l.svcCtx.Rds.HGet(ctx, key, wxid).Result()
-		//if err != nil {
-		//	return "", err
-		//}
 
 		if val == "" {
 			wx, err := l.svcCtx.DB.Wx.Query().Where(wx.WxidEQ(wxid)).First(l.ctx)
@@ -94,6 +91,9 @@ func (l *CronTask) sendWx() {
 				ctype := strconv.Itoa(int(wx.Ctype))
 				val = server.PrivateIP + ":" + server.AdminPort + ":" + wx.Port + ":" + ctype
 				l.svcCtx.Rds.HSet(ctx, key, wxid, val)
+			} else {
+				val = "0:0" + ":" + wx.Port + ":" + strconv.Itoa(int(wx.Ctype))
+				l.svcCtx.Rds.HSet(ctx, key, wxid, val)
 			}
 		}