The issue proposes optimizations to file handling but lacks specific details on implementation.
The issue suggests improving the file extraction method to avoid memory and disk-related issues by replacing subprocess.check_output with subprocess.run and optimizing file handling to avoid unnecessary copies. The requirements are somewhat clear but lack specific details on implementation and testing.
This function is used for restoring files and rather than using subprocess.check_output, could we replace it with subprocess.run . Also we are using "v" flag and for massive restore it can output lot of data. Also there is shutil.copy2 that makes a copy into site path and then doing extraction part. We could directly extract in the site path rather than moving to avoid disk related issues https://github.com/frappe/frappe/blob/f5f400008991462f17e473a955935d8200e60ff7/frappe/installer.py#L784-L813
Output of bench version
(paste here)
(paste here)
OS version / distribution, Frappe install method, etc.
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!