Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/apn_on_rails/app/models/apn/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ def self.send_notifications_for_cert(the_cert, app_id)
APN::Device.find_each(:conditions => conditions) do |dev|
dev.unsent_notifications.each do |noty|
conn.write(noty.message_for_sending)

# This seems to fix the bug where multiple notifications get
# missed by Apple when sending Push notifications as a worker
# task through Delayed::Job
sleep 0.00000001

noty.sent_at = Time.now
noty.save
end
Expand Down