Skip to content

Conversation

@ReactorScram
Copy link
Contributor

@ReactorScram ReactorScram commented Aug 8, 2024

Closes #4764

- [x] Update changelog draft
- [x] Manual test Linux

@vercel
Copy link

vercel bot commented Aug 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
firezone ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 12, 2024 5:36pm

Ok(result?)
}

fn choose_logs_to_delete(paths: &[PathBuf]) -> Vec<&Path> {
Copy link
Member

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 by connlib.)
  • Sort using .sort
  • Pop-off the last one
  • Return list

Run call this fn twice, once for .log and once for .jsonl

Copy link
Contributor Author

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

@thomaseizinger
Copy link
Member

Alternatively, it should be possible to obtain the log file we are writing to from the logger handle.

@ReactorScram
Copy link
Contributor Author

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.

@ReactorScram ReactorScram added this pull request to the merge queue Aug 12, 2024
Merged via the queue into main with commit aa9a815 Aug 12, 2024
@ReactorScram ReactorScram deleted the fix/tauri-dont-clear-all-logs branch August 12, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(connlib): connlib doesn't write to new logfile after logs are cleared

5 participants