diff --git a/internal/push/logic/callback.go b/internal/push/logic/callback.go index cc897322d..5c3c317bf 100644 --- a/internal/push/logic/callback.go +++ b/internal/push/logic/callback.go @@ -92,6 +92,7 @@ func callbackOnlinePush(operationID string, userIDList []string, msg *commonPb.M } func callbackBeforeSuperGroupOnlinePush(operationID string, groupID string, msg *commonPb.MsgData, pushToUserList *[]string) cbApi.CommonCallbackResp { + log.Debug(operationID, utils.GetSelfFuncName(), groupID, msg.String(), pushToUserList) callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} if !config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.Enable { return callbackResp diff --git a/internal/push/logic/push_to_client.go b/internal/push/logic/push_to_client.go index 1ab1ee989..8f4a635c4 100644 --- a/internal/push/logic/push_to_client.go +++ b/internal/push/logic/push_to_client.go @@ -156,7 +156,7 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) { func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) { var wsResult []*pbRelay.SingelMsgToUserResultList isOfflinePush := utils.GetSwitchFromOptions(pushMsg.MsgData.Options, constant.IsOfflinePush) - log.Debug(pushMsg.OperationID, "Get super group msg from msg_transfer And push msg", pushMsg.String()) + log.Debug(pushMsg.OperationID, "Get super group msg from msg_transfer And push msg", pushMsg.String(), config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.Enable) var pushToUserIDList []string if config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.Enable { callbackResp := callbackBeforeSuperGroupOnlinePush(pushMsg.OperationID, pushMsg.PushToUserID, pushMsg.MsgData, &pushToUserIDList) diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index c018ce4c2..f7d7d20f2 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -512,16 +512,28 @@ type PDefaultTips struct { func init() { cfgName := os.Getenv("CONFIG_NAME") - fmt.Println("GET IM DEFAULT CONFIG PATH :", Root, "ENV PATH:", cfgName, b, filepath.Dir(b)) + fmt.Println("GET IM DEFAULT CONFIG PATH :", Root, "ENV PATH:", cfgName) if len(cfgName) != 0 { - Root = cfgName + bytes, err := ioutil.ReadFile(filepath.Join(cfgName, "config", "config.yaml")) + if err != nil { + bytes, err = ioutil.ReadFile(filepath.Join(Root, "config", "config.yaml")) + if err != nil { + panic(err.Error()) + } + } else { + Root = cfgName + } + if err = yaml.Unmarshal(bytes, &Config); err != nil { + panic(err.Error()) + } + } else { + bytes, err := ioutil.ReadFile(filepath.Join(Root, "config", "config.yaml")) + if err != nil { + panic(err.Error()) + } + if err = yaml.Unmarshal(bytes, &Config); err != nil { + panic(err.Error()) + } } - bytes, err := ioutil.ReadFile(filepath.Join(Root, "config", "config.yaml")) - if err != nil { - panic(err.Error()) - } - if err = yaml.Unmarshal(bytes, &Config); err != nil { - panic(err.Error()) - } }