From 570d6a9d01fee5c20b09b71d8011fb90cb534aad Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 20 Nov 2022 23:13:57 -0600 Subject: [PATCH] storage manager: close file after copying it. --- app/logical/storage_manager.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/logical/storage_manager.rb b/app/logical/storage_manager.rb index 562d8e57c..6db72410a 100644 --- a/app/logical/storage_manager.rb +++ b/app/logical/storage_manager.rb @@ -57,6 +57,8 @@ class StorageManager def copy(src_path, dest_path) file = open(src_path) store(file, dest_path) + file&.close + nil end # Move the file from src_path to dest_path. @@ -66,6 +68,7 @@ class StorageManager def move(src_path, dest_path) copy(src_path, dest_path) delete(src_path) + nil end # Return the full URL of the file at the given path, or nil if the file