From 15bae3e0e467a19582a25e0482cd26c1c82fd7f9 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 1 Nov 2022 15:27:58 +0100 Subject: Change post-processing to be deferred only for large media types (#19617) --- app/controllers/api/v2/media_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/api/v2/media_controller.rb') diff --git a/app/controllers/api/v2/media_controller.rb b/app/controllers/api/v2/media_controller.rb index 0c1baf01d..288f847f1 100644 --- a/app/controllers/api/v2/media_controller.rb +++ b/app/controllers/api/v2/media_controller.rb @@ -3,7 +3,7 @@ class Api::V2::MediaController < Api::V1::MediaController def create @media_attachment = current_account.media_attachments.create!({ delay_processing: true }.merge(media_attachment_params)) - render json: @media_attachment, serializer: REST::MediaAttachmentSerializer, status: 202 + render json: @media_attachment, serializer: REST::MediaAttachmentSerializer, status: @media_attachment.not_processed? ? 202 : 200 rescue Paperclip::Errors::NotIdentifiedByImageMagickError render json: file_type_error, status: 422 rescue Paperclip::Error -- cgit