From 1296ab9b600f5c4b329f27144e237f4c102da617 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Mon, 16 Jul 2018 01:34:21 +0200 Subject: [PATCH] Only pre-allocate up to 5MB from big files --- plugins/Bigfile/BigfilePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Bigfile/BigfilePlugin.py b/plugins/Bigfile/BigfilePlugin.py index b4b88c37..29970836 100644 --- a/plugins/Bigfile/BigfilePlugin.py +++ b/plugins/Bigfile/BigfilePlugin.py @@ -389,7 +389,7 @@ class SiteStoragePlugin(object): os.makedirs(file_dir) f = open(file_path, 'wb') - f.truncate(size) + f.truncate(min(1024 * 1024 * 5, size)) # Only pre-allocate up to 5MB f.close() if os.name == "nt": startupinfo = subprocess.STARTUPINFO()