mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Check for None when getting the CPU frequency data
Default to -1 when an error occurs
This commit is contained in:
parent
43a93f35b3
commit
4f7e1bfa24
@ -87,7 +87,9 @@ class Stats:
|
||||
try:
|
||||
cpu_freq = psutil.cpu_freq()
|
||||
except NotImplementedError:
|
||||
cpu_freq = psutil._common.scpufreq(current=0, min=0, max=0)
|
||||
cpu_freq = None
|
||||
if cpu_freq is None:
|
||||
cpu_freq = psutil._common.scpufreq(current=-1, min=-1, max=-1)
|
||||
memory = psutil.virtual_memory()
|
||||
try:
|
||||
node_stats: NodeStatsDict = {
|
||||
|
Loading…
Reference in New Issue
Block a user