-
Notifications
You must be signed in to change notification settings - Fork 395
fix(gui-client): don't delete the log file we're currently writing to #6226
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
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| Ok(result?) | ||
| } | ||
|
|
||
| fn choose_logs_to_delete(paths: &[PathBuf]) -> Vec<&Path> { |
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.
Perhaps the following algorithm would be easier to understand:
- Given a file extension and a path
- List all files in a directory into a
Vec(also filtering byconnlib.) - Sort using
.sort - Pop-off the last one
- Return list
Run call this fn twice, once for .log and once for .jsonl
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.
I know it's premature optimization, but I was thinking this runs in linear time whereas a sort will be super-linear
|
Alternatively, it should be possible to obtain the log file we are writing to from the logger handle. |
Yeah that would be better long-term, especially once #5453 closes. |
Closes #4764