mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 20:30:40 +08:00
push update
This commit is contained in:
parent
e9a515ac34
commit
ce554fc442
@ -7,6 +7,9 @@
|
|||||||
package logic
|
package logic
|
||||||
|
|
||||||
import (
|
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/config"
|
||||||
"Open_IM/pkg/common/constant"
|
"Open_IM/pkg/common/constant"
|
||||||
"Open_IM/pkg/common/kafka"
|
"Open_IM/pkg/common/kafka"
|
||||||
@ -15,11 +18,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
rpcServer RPCServer
|
rpcServer RPCServer
|
||||||
pushCh PushConsumerHandler
|
pushCh PushConsumerHandler
|
||||||
pushTerminal []int32
|
pushTerminal []int32
|
||||||
producer *kafka.Producer
|
producer *kafka.Producer
|
||||||
successCount uint64
|
offlinePusher pusher.OfflinePusher
|
||||||
|
successCount uint64
|
||||||
)
|
)
|
||||||
|
|
||||||
func Init(rpcPort int) {
|
func Init(rpcPort int) {
|
||||||
@ -31,6 +35,12 @@ func Init(rpcPort int) {
|
|||||||
func init() {
|
func init() {
|
||||||
producer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.Ws2mschat.Topic)
|
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)
|
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() {
|
func Run() {
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
package logic
|
package logic
|
||||||
|
|
||||||
import (
|
import (
|
||||||
pusher "Open_IM/internal/push"
|
|
||||||
"Open_IM/internal/push/getui"
|
|
||||||
jpush "Open_IM/internal/push/jpush"
|
jpush "Open_IM/internal/push/jpush"
|
||||||
"Open_IM/pkg/common/config"
|
"Open_IM/pkg/common/config"
|
||||||
"Open_IM/pkg/common/constant"
|
"Open_IM/pkg/common/constant"
|
||||||
@ -102,14 +100,6 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) {
|
|||||||
content = constant.ContentType2PushContent[constant.Common]
|
content = constant.ContentType2PushContent[constant.Common]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var offlinePusher pusher.OfflinePusher
|
|
||||||
if config.Config.Push.Getui.Enable {
|
|
||||||
log.NewInfo(pushMsg.OperationID, utils.GetSelfFuncName(), config.Config.Push.Getui)
|
|
||||||
offlinePusher = getui.GetuiClient
|
|
||||||
}
|
|
||||||
if config.Config.Push.Jpns.Enable {
|
|
||||||
offlinePusher = jpush.JPushClient
|
|
||||||
}
|
|
||||||
if offlinePusher == nil {
|
if offlinePusher == nil {
|
||||||
offlinePusher = jpush.JPushClient
|
offlinePusher = jpush.JPushClient
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user