Render cpu_load_percent segment even when psutil returns 0.0 (#2111)
Although the docs for psutil say 0.0 is a nonsense value that's returned first and supposed to be ignored, but on a relatively idle system it will actually return 0.0 occasionally after that. So at the expense of displaying that "nonsense value" when the statusbar first loads, this change gets rid of the visual disruptions of having the segment pop out and back in periodically. Fixes #2110. Co-authored-by: 2rs2ts <2rs2ts@github>
This commit is contained in:
parent
14a4100c4c
commit
8c6874d855
|
@ -90,8 +90,6 @@ try:
|
|||
self.exception('Exception while calculating cpu_percent: {0}', str(e))
|
||||
|
||||
def render(self, cpu_percent, format='{0:.0f}%', **kwargs):
|
||||
if not cpu_percent:
|
||||
return None
|
||||
return [{
|
||||
'contents': format.format(cpu_percent),
|
||||
'gradient_level': cpu_percent,
|
||||
|
|
Loading…
Reference in New Issue