wangchuanjin 7 yıl önce
ebeveyn
işleme
04617342fa

+ 2 - 0
src/jfw/modules/pushent/src/main.go

@@ -14,12 +14,14 @@ import (
 	"rpcpush"
 	"time"
 	"timetask"
+	"weixinrpc"
 )
 
 func init() {
 	redis.InitRedisBySize(config.Sysconfig["redisServers"].(string), 200, 30, 300)
 	elastic.InitElasticSize(config.Sysconfig["elasticsearch"].(string), util.IntAllDef(config.Sysconfig["elasticPoolSize"], 30))
 	followpush.MaxSearch = util.IntAllDef(config.Sysconfig["maxSearch"], 10000)
+	weixinrpc.WeixinRpcServer = config.Sysconfig["weixinRpcServer"].(string)
 }
 
 func main() {

+ 3 - 3
src/jfw/modules/pushent/src/weixinrpc/weixinrpc.go

@@ -1,7 +1,6 @@
 package weixinrpc
 
 import (
-	"config"
 	"log"
 	"net/rpc"
 	"qfw/util"
@@ -12,6 +11,7 @@ import (
 )
 
 var wxpool chan bool = make(chan bool, 30)
+var WeixinRpcServer string
 
 //微信远程调用,实现模板发送消息
 func SendWinXin(p *qrpc.NotifyMsg) {
@@ -20,7 +20,7 @@ func SendWinXin(p *qrpc.NotifyMsg) {
 		<-wxpool
 	}()
 	util.Try(func() {
-		client, err := rpc.DialHTTP("tcp", config.Sysconfig["weixinRpcServer"].(string))
+		client, err := rpc.DialHTTP("tcp", WeixinRpcServer)
 		defer client.Close()
 		if err != nil {
 			log.Println(err.Error())
@@ -46,7 +46,7 @@ func FollowPush(p *qrpc.NotifyMsg) {
 		<-wxpool
 	}()
 	util.Try(func() {
-		client, err := rpc.DialHTTP("tcp", config.Sysconfig["weixinRpcServer"].(string))
+		client, err := rpc.DialHTTP("tcp", WeixinRpcServer)
 		defer client.Close()
 		if err != nil {
 			log.Println(err.Error())

+ 2 - 0
src/jfw/modules/pushproject/src/main.go

@@ -14,12 +14,14 @@ import (
 	"rpcpush"
 	"time"
 	"timetask"
+	"weixinrpc"
 )
 
 func init() {
 	redis.InitRedisBySize(config.Sysconfig["redisServers"].(string), 200, 30, 300)
 	elastic.InitElasticSize(config.Sysconfig["elasticsearch"].(string), util.IntAllDef(config.Sysconfig["elasticPoolSize"], 30))
 	followpush.MaxSearch = util.IntAllDef(config.Sysconfig["maxSearch"], 10000)
+	weixinrpc.WeixinRpcServer = config.Sysconfig["weixinRpcServer"].(string)
 }
 
 func main() {

+ 3 - 3
src/jfw/modules/pushproject/src/weixinrpc/weixinrpc.go

@@ -1,7 +1,6 @@
 package weixinrpc
 
 import (
-	"config"
 	"log"
 	"net/rpc"
 	"qfw/util"
@@ -12,6 +11,7 @@ import (
 )
 
 var wxpool chan bool = make(chan bool, 30)
+var WeixinRpcServer string
 
 //微信远程调用,实现模板发送消息
 func SendWinXin(p *qrpc.NotifyMsg) {
@@ -20,7 +20,7 @@ func SendWinXin(p *qrpc.NotifyMsg) {
 		<-wxpool
 	}()
 	util.Try(func() {
-		client, err := rpc.DialHTTP("tcp", config.Sysconfig["weixinRpcServer"].(string))
+		client, err := rpc.DialHTTP("tcp", WeixinRpcServer)
 		defer client.Close()
 		if err != nil {
 			log.Println(err.Error())
@@ -46,7 +46,7 @@ func FollowPush(p *qrpc.NotifyMsg) {
 		<-wxpool
 	}()
 	util.Try(func() {
-		client, err := rpc.DialHTTP("tcp", config.Sysconfig["weixinRpcServer"].(string))
+		client, err := rpc.DialHTTP("tcp", WeixinRpcServer)
 		defer client.Close()
 		if err != nil {
 			log.Println(err.Error())