A platform for community discussion. Free, open, simple.
FIX: Open file handles 'just in time' during s3 migration (#28806)
David Taylor9a362869201b
diff --git a/lib/file_store/to_s3_migration.rb b/lib/file_store/to_s3_migration.rbindex ba8b79ee518..75b5be278ac 100644--- a/lib/file_store/to_s3_migration.rb+++ b/lib/file_store/to_s3_migration.rb@@ -211,7 +211,8 @@ module FileStoreUPLOAD_CONCURRENCY.times.map doThread.new dowhile obj = queue.pop- if s3.put_object(obj[:options])+ opts_with_file = obj[:options].merge(body: File.open(obj[:path], "rb"))+ if s3.put_object(opts_with_file)putc "."lock.synchronize { synced += 1 }else@@ -237,7 +238,6 @@ module FileStoreoptions = {acl: SiteSetting.s3_use_acls ? "public-read" : nil,- body: File.open(path, "rb"),bucket: bucket,content_type: MiniMime.lookup_by_filename(name)&.content_type,content_md5: content_md5,