-
-
Notifications
You must be signed in to change notification settings - Fork 119
fix: cleanup temporary directories #566
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
Conversation
_ = os.MkdirAll(filepath.Dir(path), 0755) | ||
} | ||
return path | ||
return filepath.Join(p.tempDir, fmt.Sprintf("%s-router.php", p.Version.Version)) |
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.
Note for the reviewers: I moved the routing file to the same location as the FPM config.
This way I can always create and clean the directory no matter the SAPI
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.
Regarding cleaning up existing empty directories, can we at least remove the ones that are older than x days?
good idea, will do |
Co-authored-by: Fabien Potencier <fabien@potencier.org>
please note that this might take a while because we clean by batches, use `find ~/.symfony5/tmp -type d -mindepth 1 -maxdepth 1 -delete` if you are eager
@fabpot cleanup added. I considered directories as stale after 7 days. wdyt? |
Great! Thank you. |
Thanks, unfortunately it is somehow not working for me. Are old files removed only on "clean" shutdown of the server? I cannot gracefully stop server with |
AFAICT this error is not related to this PR and is only related to #397 (on which I didn't had the opportunity to work so far) |
Yes, my question is not about this error, but on conditions required for cleanup process to be performed - if it requires "clean" shutdown by calling |
On any shutdown. But your error happens during the shutdown process and things are not necessarily linear in Go so your error might end up stopping the cleaning process early on |
Fixes #383
Fixes #553
It also seems logical to work on cleaning any temporary directory while working on cleaning the
~/.symfony5/tmp
directory so this is a slightly bigger PR.The second commit can extracted though if we want to focus on a single directory for now.
Unfortunately cleaning up previous
tmp
directories does not seem like a good idea because they can still be in-use.