@ -7,6 +7,9 @@
package logic
import (
pusher "Open_IM/internal/push"
"Open_IM/internal/push/getui"
jpush "Open_IM/internal/push/jpush"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/kafka"
@ -15,11 +18,12 @@ import (
)
var (
rpcServer RPCServer
pushCh PushConsumerHandler
pushTerminal [ ] int32
producer * kafka . Producer
successCount uint64
rpcServer RPCServer
pushCh PushConsumerHandler
pushTerminal [ ] int32
producer * kafka . Producer
offlinePusher pusher . OfflinePusher
successCount uint64
)
func Init ( rpcPort int ) {
@ -31,6 +35,12 @@ func Init(rpcPort int) {
func init ( ) {
producer = kafka . NewKafkaProducer ( config . Config . Kafka . Ws2mschat . Addr , config . Config . Kafka . Ws2mschat . Topic )
statistics . NewStatistics ( & successCount , config . Config . ModuleName . PushName , fmt . Sprintf ( "%d second push to msg_gateway count" , constant . StatisticsTimeInterval ) , constant . StatisticsTimeInterval )
if config . Config . Push . Getui . Enable {
offlinePusher = getui . GetuiClient
}
if config . Config . Push . Jpns . Enable {
offlinePusher = jpush . JPushClient
}
}
func Run ( ) {