You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This loop is brutally slow - you're looping through EVERY device looking for messages to send! The old version just looked for notifications with sent_at nil. That is much faster, and I ended up downgrading when I realized what was happening:
APN::Connection.open_for_delivery({:cert => the_cert}) do |conn, sock|
APN::Device.find_each(:conditions => conditions) do |dev|
dev.unsent_notifications.each do |noty|
conn.write(noty.message_for_sending)
noty.sent_at = Time.now
noty.save
end
end
end
The text was updated successfully, but these errors were encountered:
This loop is brutally slow - you're looping through EVERY device looking for messages to send! The old version just looked for notifications with sent_at nil. That is much faster, and I ended up downgrading when I realized what was happening:
The text was updated successfully, but these errors were encountered: