Skip to content
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

Make System::refresh_all and System::refresh_specifics remove dead processes and update docs #1431

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/common/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ impl System {
/// Refreshes according to the given [`RefreshKind`]. It calls the corresponding
/// "refresh_" methods.
///
/// It will remove dead processes if [`RefreshKind::processes`] returns `Some`.
/// If you want to keep dead processes, use [`System::refresh_processes_specifics`]
/// directly.
///
/// ```
/// use sysinfo::{ProcessRefreshKind, RefreshKind, System};
///
Expand All @@ -109,7 +113,7 @@ impl System {
self.refresh_cpu_specifics(kind);
}
if let Some(kind) = refreshes.processes() {
self.refresh_processes_specifics(ProcessesToUpdate::All, false, kind);
self.refresh_processes_specifics(ProcessesToUpdate::All, true, kind);
}
}

Expand All @@ -120,6 +124,9 @@ impl System {
/// Don't forget to take a look at [`ProcessRefreshKind::everything`] method to see what it
/// will update for processes more in details.
///
/// It will remove dead processes. If you want to keep dead processes, use
/// [`System::refresh_processes_specifics`] directly.
///
/// ```no_run
/// use sysinfo::System;
///
Expand Down
Loading