Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


APN::App.send_notifications results in high DB load #20

andreasmueller opened this Issue · 1 comment

2 participants



we recently switched from wireframe apn_on_rails to PRX apn_on_rails (0.4.1), and we noticed a significant increase in DB load. It seems that this is due to a nested loop in the function send_notifications_for_cert (in the app model), which creates a DB query for each device, whereas the wireframe version uses a simple APN::Notification.all(:conditions => {:sent_at => nil}) to find all notifications to send.

I understand the benefit of being able to specify an app_id per device, but I think it should still be possible to just use one query to get all notifications to send, which would be significantly faster.


Good point. If you'd like to take a crack at it and submitting a pull request, that would be great. I'll try to take a look as soon as I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.