chore: Fix Twilio file uploads (#2088)

This commit is contained in:
Sojan Jose 2021-04-13 14:09:51 +05:30 committed by GitHub
parent 04a9dc630a
commit c4ae901591
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -148,7 +148,9 @@ class Message < ApplicationRecord
end
def send_reply
::SendReplyJob.perform_later(id)
# FIXME: Giving it few seconds for the attachment to be uploaded to the service
# active storage attaches the file only after commit
attachments.blank? ? ::SendReplyJob.perform_later(id) : ::SendReplyJob.set(wait: 2.seconds).perform_later(id)
end
def reopen_conversation