⚡ Optimize event log export to use async I/O#148
Conversation
- Extract `read_and_format_logs` for testability - Use `spawn_blocking` for file I/O in `collect_event_logs` and `export_event_logs` - Make `get_event_logs` async - Add unit test for log formatting logic Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
💡 What:
collect_event_logsinapps/threshold/src-tauri/src/event_logs.rsto be anasync fnand usetauri::async_runtime::spawn_blockingfor file reading and formatting.read_and_format_logsfunction to facilitate testing and isolation.export_event_logsto beasync, awaitcollect_event_logs, and usespawn_blockingfor directory creation and file writing.get_event_logsto beasyncand awaitcollect_event_logs.read_and_format_logs_worksto verify the logic.🎯 Why:
spawn_blockingensures the application remains responsive during log export.📊 Measured Improvement:
PR created automatically by Jules for task 6279845040915257839 started by @ScottMorris