FIX: Processing incoming email should be done in a background job.

This commit is contained in:
Guo Xiang Tan
2017-04-24 12:06:28 +08:00
parent dad2024094
commit 423f2ab228
5 changed files with 16 additions and 6 deletions

View File

@ -553,7 +553,7 @@ module Email
def create_post_with_attachments(options={})
# deal with attachments
attachments.each do |attachment|
tmp = Tempfile.new("discourse-email-attachment")
tmp = Tempfile.new(["discourse-email-attachment", File.extname(attachment.filename)])
begin
# read attachment
File.open(tmp.path, "w+b") { |f| f.write attachment.body.decoded }