MerginMaps/work-packages

Clean the temp_dir on unsuccessful runs of wp_mergin.py

Opened this issue · 0 comments

The second to last line of code in wp_mergin.py (shutil.rmtree()) only executes if the scripts has run perfectly.
In cases where there have been a crash for whatever reason, the temp_dir doesn't get cleaned.

Having all the code in a try-except, with shutil.rmtree in the finally block could solve this, I think.

Our implementation of mergin-work-packages is that it runs within a Python-daemon indefinitely (when there are crashes, it just restarts), so if the temp_dirs don't get cleaned on unsuccessful runs, our server runs out of space.