-
Notifications
You must be signed in to change notification settings - Fork 67
fix: fix file locking error when removing cache folder #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| import os | ||
| import shutil | ||
| import stat | ||
| import time | ||
| import uuid | ||
|
|
||
|
|
||
|
|
@@ -17,6 +19,14 @@ def setup_workspace(folder): | |
| return log_file, working_dir | ||
|
|
||
|
|
||
| def cleanup_workspace(folder): | ||
| if os.path.exists(folder): | ||
| shutil.rmtree(folder) | ||
| def cleanup_workspace(working_dir): | ||
| if not os.path.exists(working_dir): | ||
| return | ||
| st = os.stat(working_dir) | ||
| os.chmod(working_dir, st.st_mode | stat.S_IWRITE) | ||
|
|
||
| time.sleep(0.5) | ||
| try: | ||
| shutil.rmtree(working_dir) | ||
| except Exception: | ||
github-code-quality[bot] marked this conversation as resolved.
Fixed
Show fixed
Hide fixed
github-code-quality[bot] marked this conversation as resolved.
Fixed
Show fixed
Hide fixed
github-code-quality[bot] marked this conversation as resolved.
Fixed
Show fixed
Hide fixed
|
||
| pass | ||
|
Comment on lines
+31
to
+32
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Silently swallowing exceptions with |
||
Uh oh!
There was an error while loading. Please reload this page.