From 7167ce83230e354ee1e13d1b11a8482f308bbea4 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 23 Oct 2016 21:05:31 +0800 Subject: [PATCH] update retry func. Signed-off-by: Bo-Yi Wu --- gorush/notification.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gorush/notification.go b/gorush/notification.go index da1f7ff..e14a6b7 100644 --- a/gorush/notification.go +++ b/gorush/notification.go @@ -429,7 +429,6 @@ func PushToAndroid(req PushNotification) bool { LogAccess.Debug("Start push notification for Android") var APIKey string - var isError = false // check message err := CheckMessage(req) @@ -440,6 +439,7 @@ func PushToAndroid(req PushNotification) bool { } Retry: + var isError = false notification := GetAndroidNotification(req) if APIKey = PushConf.Android.APIKey; req.APIKey != "" { @@ -474,9 +474,8 @@ Retry: if isError == true && req.Retry < PushConf.Android.MaxRetry { req.Retry++ - // reset to default + // resend fail token req.Tokens = newTokens - isError = false goto Retry }