gopsutil icon indicating copy to clipboard operation
gopsutil copied to clipboard

Slow disk.Partitions(true) on Windows with missing mapped network drives

Open tmm1 opened this issue 2 years ago • 1 comments

Describe the bug disk.Partitions(true) can take 20s+ when mapped drives exist on windows and the remote server is not available

The error returned is:

Error 0: The network path was not found.

According to http://www.delphigroups.info/2/3d/477068.html there is no timeout control

tmm1 avatar Jan 10 '23 18:01 tmm1

Now I raise a PR(#1407) which adds the functionality to handle context to that method. After merging, we can use context.Withtimeout to set the appropriate timeout.

shirou avatar Jan 14 '23 09:01 shirou