-
-
Notifications
You must be signed in to change notification settings - Fork 335
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
Tasks aren't refreshed in System
#1452
Comments
The above code snippet produces the correct result on Kali WSL. Perhaps try using Below is the output I'm getting using your code snippet, where both numbers are matching. Terminal Output (Kali Linux WSL):
|
When you say "tasks aren't refreshed", do you mean you get the same count every time or do you mean the existing tasks information are not updated? |
The counts will change as programs are opened or closed. The 2 counts should match but they don't. Using data from |
That doesn't help at all trying to understand you. ^^' So the process list is not refreshed correctly, right? |
The list of PIDs are correct, as in this always returns println!("{}", system.processes().keys().copied().collect::<HashSet<Pid>>() == system_new.processes().keys().copied().collect::<HashSet<Pid>>()); However println!("{}", get_tasks(&system) == get_tasks(&system_new)); This will print |
Describe the bug
I'm using
.tasks()
to count the # of processes on Linux.Tasks aren't refreshed in an existing instance of
System
. To get the correct value, I have to create a new instance ofSystem
every time.sysinfo
version: v0.33.1To Reproduce
In the following code, what's printed should match, but they don't:
The text was updated successfully, but these errors were encountered: