-
Notifications
You must be signed in to change notification settings - Fork 411
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
Fix temp dir creation #2018
Fix temp dir creation #2018
Conversation
@@ -260,7 +260,6 @@ var tempDir = func() string { | |||
if err != nil { | |||
panic("failed to create temp dir: " + err.Error()) | |||
} | |||
defer os.RemoveAll(dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This defer call just immediately removed the folder after being created. This causes wasmvm to create the folder again and then it is never deleted. Over time that leads to a lot of temp folders accumulating when people run the cli.
What we actually want to do (and what is implemented in this PR) is to remove it after we are done with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
As you said, we need to communicate it to the chains.
Maybe we could add a comment explaining why we need it etc. WDYT?
Sounds good. I added a comment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! LGTM 👍
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2018 +/- ##
==========================================
+ Coverage 48.79% 48.81% +0.01%
==========================================
Files 65 65
Lines 10079 10079
==========================================
+ Hits 4918 4920 +2
+ Misses 4726 4725 -1
+ Partials 435 434 -1 |
fixes #2017
Looks like most chains copied this code for their wasmd integration.
We should probably inform them about this change.