refactor initial variable
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
45a3ca891e
commit
7fb51220c1
|
@ -393,16 +393,21 @@ func PushToIOS(req PushNotification) bool {
|
||||||
if PushConf.Core.Sync {
|
if PushConf.Core.Sync {
|
||||||
defer req.WaitDone()
|
defer req.WaitDone()
|
||||||
}
|
}
|
||||||
var retryCount = 0
|
|
||||||
var maxRetry = PushConf.Ios.MaxRetry
|
var (
|
||||||
|
retryCount = 0
|
||||||
|
maxRetry = PushConf.Ios.MaxRetry
|
||||||
|
)
|
||||||
|
|
||||||
if req.Retry > 0 && req.Retry < maxRetry {
|
if req.Retry > 0 && req.Retry < maxRetry {
|
||||||
maxRetry = req.Retry
|
maxRetry = req.Retry
|
||||||
}
|
}
|
||||||
|
|
||||||
Retry:
|
Retry:
|
||||||
var isError = false
|
var (
|
||||||
var newTokens []string
|
isError = false
|
||||||
|
newTokens []string
|
||||||
|
)
|
||||||
|
|
||||||
notification := GetIOSNotification(req)
|
notification := GetIOSNotification(req)
|
||||||
|
|
||||||
|
@ -506,9 +511,12 @@ func PushToAndroid(req PushNotification) bool {
|
||||||
if PushConf.Core.Sync {
|
if PushConf.Core.Sync {
|
||||||
defer req.WaitDone()
|
defer req.WaitDone()
|
||||||
}
|
}
|
||||||
var APIKey string
|
|
||||||
var retryCount = 0
|
var (
|
||||||
var maxRetry = PushConf.Android.MaxRetry
|
APIKey string
|
||||||
|
retryCount = 0
|
||||||
|
maxRetry = PushConf.Android.MaxRetry
|
||||||
|
)
|
||||||
|
|
||||||
if req.Retry > 0 && req.Retry < maxRetry {
|
if req.Retry > 0 && req.Retry < maxRetry {
|
||||||
maxRetry = req.Retry
|
maxRetry = req.Retry
|
||||||
|
|
Loading…
Reference in New Issue