Skip to content

Commit

Permalink
Speed up apns client (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
capella authored and cscatolini committed May 3, 2019
1 parent 19cf20d commit 481763b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions config/default.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
gracefulShutdownTimeout: 30
apns:
concurrentWorkers: 100
connectionPoolSize: 10
concurrentWorkers: 300
connectionPoolSize: 1
logStatsInterval: 10000
apps: "game"
certs:
Expand Down
4 changes: 2 additions & 2 deletions config/test.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
gracefulShutdownTimeout: 10
apns:
concurrentWorkers: 100
connectionPoolSize: 10
concurrentWorkers: 300
connectionPoolSize: 1
logStatsInterval: 750
apps: "game"
certs:
Expand Down
4 changes: 3 additions & 1 deletion extensions/apns_push_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ func (p *APNSPushQueue) pushWorker() {

for notification := range p.pushChannel {
client := <-p.clients
res, err := client.Push(notification)
p.clients <- client

res, err := client.Push(notification)
if err != nil {
l.WithError(err).Error("push error")
}
Expand All @@ -137,6 +138,7 @@ func (p *APNSPushQueue) pushWorker() {
DeviceToken: notification.DeviceToken,
}
p.responseChannel <- newRes

}
}

Expand Down

0 comments on commit 481763b

Please sign in to comment.