chore(NSQ): remove nsq package and update run func (#614)

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2021-07-25 08:35:49 +08:00
committed by GitHub
parent 0b0f47e4f9
commit e08e4c09ca
4 changed files with 17 additions and 24 deletions

View File

@@ -254,7 +254,12 @@ func CheckPushConf(cfg config.ConfYaml) error {
// SendNotification send notification
func SendNotification(req queue.QueuedMessage) {
v, _ := req.(*PushNotification)
v, ok := req.(*PushNotification)
if !ok {
if err := json.Unmarshal(req.Bytes(), v); err != nil {
return
}
}
defer func() {
v.WaitDone()
@@ -269,3 +274,9 @@ func SendNotification(req queue.QueuedMessage) {
PushToHuawei(*v)
}
}
// Run send notification
var Run = func(msg queue.QueuedMessage) error {
SendNotification(msg)
return nil
}