From 0b4b40855226da20b9dc1c4e10ab0c3be00fe3de Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Wed, 21 Dec 2022 18:58:36 +0800 Subject: [PATCH] push --- internal/push/getui/push.go | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/internal/push/getui/push.go b/internal/push/getui/push.go index 69875a23d..21176b466 100644 --- a/internal/push/getui/push.go +++ b/internal/push/getui/push.go @@ -152,18 +152,9 @@ func (g *Getui) Push(userIDList []string, title, detailContent, operationID stri ChannelName: config.Config.Push.Getui.ChannelName, } if len(userIDList) > 1 { - taskID, err := db.DB.GetGetuiTaskID() + taskID, err := g.GetTaskID(operationID, token, pushReq) if err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), "GetGetuiTaskID failed", err.Error()) - } else { - log.NewDebug(operationID, utils.GetSelfFuncName(), "taskID", taskID) - } - if taskID == "" || err != nil { - taskID, err = g.GetTaskIDAndSave2Redis(operationID, token, pushReq) - if err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), "GetTaskIDAndSave2Redis failed", err.Error()) - return "", utils.Wrap(err, "") - } + return "", utils.Wrap(err, "GetTaskIDAndSave2Redis failed") } var IsAsync = true pushReq.IsAsync = &IsAsync @@ -176,7 +167,7 @@ func (g *Getui) Push(userIDList []string, title, detailContent, operationID stri err = g.request(BatchPushURL, pushReq, token, &pushResp, operationID) } else { reqID := utils.OperationIDGenerator() - pushReq := PushReq{ + pushReq = PushReq{ RequestID: &reqID, Audience: struct { Alias []string `json:"alias"`