From db310f61d82bef66913846d1ab6a5e56e2fdf7d5 Mon Sep 17 00:00:00 2001 From: Nastia Gorokhova-Alekseeva Date: Thu, 8 Dec 2022 11:42:29 +0300 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=BA=D1=80=D1=8B=D0=B2=D0=B0?= =?UTF-8?q?=D0=B5=D0=BC=20tempfile=20=D0=B2=20=D1=85=D1=80=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=BB=D0=B8=D1=89=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/paperclip/storage/no_cache_s3.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/paperclip/storage/no_cache_s3.rb b/lib/paperclip/storage/no_cache_s3.rb index 54ed56e..7ef960e 100644 --- a/lib/paperclip/storage/no_cache_s3.rb +++ b/lib/paperclip/storage/no_cache_s3.rb @@ -141,6 +141,11 @@ module Paperclip unless delay_processing? && dirty? (self.class.store_ids - [self.class.main_store_id]).each { |store_id| enqueue_sync_job(store_id) } end + # HACK: Iostream пишет в tempfile, и он нигде не закрывается. Будем закрывать хотя бы тут + if queued_for_write[:original]&.is_a?(Tempfile) + queued_for_write[:original].close + queued_for_write[:original].unlink + end queued_for_write.clear end