Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
andreasmueller opened this issue Jan 17, 2011 · 1 comment
Open

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

andreasmueller opened this issue Jan 17, 2011 · 1 comment

Comments

@andreasmueller
Copy link

Hello

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.

@rebeccanesson
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants