MerginMaps / MerginMaps/work-packages

Clean the temp_dir on unsuccessful runs of wp_mergin.py

Open
#37 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
11
Forks
6
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open wp_mergin.py and inspect the existing shutil.rmtree() cleanup and the surrounding run flow. Ensure cleanup also occurs when the script crashes, then verify that temporary directories are removed after both successful and unsuccessful runs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.