Skip to content

Commit

Permalink
feat: change push config (#2775)
Browse files Browse the repository at this point in the history
  • Loading branch information
icey-yu authored Oct 24, 2024
1 parent a84f7bd commit 0d03b46
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/push/offlinepush/offlinepusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ import (
"github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options"
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache"
"github.com/openimsdk/tools/log"
"github.com/openimsdk/tools/mcontext"
"strings"
)

const (
geTUI = "geTui"
geTUI = "getui"
firebase = "fcm"
jPush = "jpush"
)
Expand All @@ -38,6 +41,7 @@ type OfflinePusher interface {

func NewOfflinePusher(pushConf *config.Push, cache cache.ThirdCache, fcmConfigPath string) (OfflinePusher, error) {
var offlinePusher OfflinePusher
pushConf.Enable = strings.ToLower(pushConf.Enable)
switch pushConf.Enable {
case geTUI:
offlinePusher = getui.NewClient(pushConf, cache)
Expand All @@ -47,6 +51,7 @@ func NewOfflinePusher(pushConf *config.Push, cache cache.ThirdCache, fcmConfigPa
offlinePusher = jpush.NewClient(pushConf)
default:
offlinePusher = dummy.NewClient()
log.ZWarn(mcontext.WithMustInfoCtx([]string{"push start", "admin", "admin", ""}), "Unknown push config", nil)
}
return offlinePusher, nil
}

0 comments on commit 0d03b46

Please sign in to comment.