Skip to content

Comments

Check, Fix, Optimize and Update README#200

Open
Cylae wants to merge 1 commit intomainfrom
check-fix-optimize-readme-10559388972842302567
Open

Check, Fix, Optimize and Update README#200
Cylae wants to merge 1 commit intomainfrom
check-fix-optimize-readme-10559388972842302567

Conversation

@Cylae
Copy link
Owner

@Cylae Cylae commented Feb 20, 2026

Performed a comprehensive check, fix, and optimization pass on the server_manager codebase.

  1. Optimized Startup: Removed the heavy sys.refresh_all() call during server startup. The system stats are now lazily loaded upon the first request to the dashboard.
  2. Improved Concurrency: The user management handlers (add_user, delete_user) were refactored to use spawn_blocking. This prevents blocking the main Tokio executor threads with CPU-intensive (bcrypt) or blocking I/O (useradd/userdel) operations.
  3. Fixed Disk Stats: Added sys.refresh_disks() to the hardware detection logic, ensuring that disk usage percentages are available immediately for profile evaluation. Also added sys.refresh_disks_list() to the dashboard to support dynamic mounting.
  4. Updated Documentation: Added a section to the README explaining the system optimizations, consistent with the user's request to "Update the README".

Verified with cargo check, cargo clippy, and cargo test.


PR created automatically by Jules for task 10559388972842302567 started by @Cylae

- **Hardware**: Added `sys.refresh_disks()` in `HardwareInfo::detect` to ensure disk usage statistics are populated immediately.
- **Web UI**:
    - Replaced `System::new_all()` with `System::new()` in `start_server` to reduce startup time.
    - Initialized `last_system_refresh` to `UNIX_EPOCH` to trigger immediate data collection on the first dashboard request.
    - Added `sys.refresh_disks_list()` to the dashboard refresh logic to detect new mounts.
    - Refactored `add_user_handler` and `delete_user_handler` to use `tokio::task::spawn_blocking`, offloading heavy operations (password hashing, user creation) from the async runtime.
- **Documentation**: Updated `README.md` (English and French) with a new "Optimizations & Performance" section detailing the architectural improvements.
@google-labs-jules
Copy link
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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.

1 participant