diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-11-01 15:27:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-01 15:27:58 +0100 |
commit | 15bae3e0e467a19582a25e0482cd26c1c82fd7f9 (patch) | |
tree | e31f10cfcbcbc6168934031ddf9d0c81615afc5b /app/controllers/api/v2 | |
parent | c68e6b52d9d4da5d34380587cb6faaabdfedfb35 (diff) |
Change post-processing to be deferred only for large media types (#19617)
Diffstat (limited to 'app/controllers/api/v2')
-rw-r--r-- | app/controllers/api/v2/media_controller.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |