Skip to content

Commit

Permalink
fix graceful shutdown bug introduced by push_expiry, bumped version
Browse files Browse the repository at this point in the history
  • Loading branch information
felipejfc committed Aug 7, 2017
1 parent d5c656f commit a554bfb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ gcm:
queue:
topics:
- "com.games.test"
brokers: "localhost:9940"
brokers: "localhost:9941"
group: testGroup
sessionTimeout: 6000
offsetResetStrategy: latest
Expand Down
3 changes: 3 additions & 0 deletions extensions/apns_message_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ func (a *APNSMessageHandler) sendMessage(message []byte) error {
if n.PushExpiry > 0 && n.PushExpiry < time.Now().Unix() {
l.Warnf("ignoring push message because it has expired: %s", n.Payload)
a.ignoredMessages++
if a.pendingMessagesWG != nil {
a.pendingMessagesWG.Done()
}
return nil
}
statsReporterHandleNotificationSent(a.StatsReporters)
Expand Down
3 changes: 3 additions & 0 deletions extensions/gcm_message_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ func (g *GCMMessageHandler) sendMessage(message []byte) error {
if km.PushExpiry > 0 && km.PushExpiry < time.Now().Unix() {
l.Warnf("ignoring push message because it has expired: %s", km.Data)
g.ignoredMessages++
if g.pendingMessagesWG != nil {
g.pendingMessagesWG.Done()
}
return nil
}
l.WithField("message", km).Debug("sending message to gcm")
Expand Down
2 changes: 1 addition & 1 deletion util/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
package util

//Version is the current version of pusher
var Version = "2.1.0"
var Version = "2.1.1"

0 comments on commit a554bfb

Please sign in to comment.