Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
simplified retry process.
Browse files Browse the repository at this point in the history
  • Loading branch information
cubicdaiya committed May 11, 2016
1 parent c87e35f commit c2b8e4a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions gaurun/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func pushNotificationWorker() {

for {
notification := <-QueueNotification

Retry:
switch notification.Platform {
case PlatFormIos:
success = pushNotificationIos(notification)
Expand All @@ -28,10 +28,8 @@ func pushNotificationWorker() {
continue
}
if !success && notification.Retry < retryMax {
if len(QueueNotification) < cap(QueueNotification) {
notification.Retry++
QueueNotification <- notification
}
notification.Retry++
goto Retry
}
}
}

0 comments on commit c2b8e4a

Please sign in to comment.