fix alerts
This commit is contained in:
parent
92dd51dbed
commit
9b996157ed
34
nohang
34
nohang
@ -837,30 +837,41 @@ def check_zram():
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'''
|
||||||
def format_time(t):
|
def format_time(t):
|
||||||
"""
|
t = int(t)
|
||||||
"""
|
if t < 60:
|
||||||
|
return '{} sec'.format(t)
|
||||||
|
if t >= 60 and t < 3600:
|
||||||
|
m = t // 60
|
||||||
|
s = t % 60
|
||||||
|
return '{} min {} sec'.format(m, s)
|
||||||
|
h = t // 3600
|
||||||
|
s0 = t - h * 3600
|
||||||
|
m = s0 // 60
|
||||||
|
s = s0 % 60
|
||||||
|
return '{} h {} min {} sec'.format(h, m, s)
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def format_time(t):
|
||||||
t = int(t)
|
t = int(t)
|
||||||
|
|
||||||
if t < 60:
|
if t < 60:
|
||||||
return '{} sec'.format(t)
|
return '{} sec'.format(t)
|
||||||
|
|
||||||
elif (t < 3600 and t >= 60):
|
if t > 3600:
|
||||||
m = t // 60
|
|
||||||
s = t % 60
|
|
||||||
return '{} min {} sec'.format(m, s)
|
|
||||||
|
|
||||||
else:
|
|
||||||
h = t // 3600
|
h = t // 3600
|
||||||
s0 = t - h * 3600
|
s0 = t - h * 3600
|
||||||
m = s0 // 60
|
m = s0 // 60
|
||||||
s = s0 % 60
|
s = s0 % 60
|
||||||
return '{} h {} min {} sec'.format(h, m, s)
|
return '{} h {} min {} sec'.format(h, m, s)
|
||||||
|
|
||||||
|
m = t // 60
|
||||||
|
s = t % 60
|
||||||
|
return '{} min {} sec'.format(m, s)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1979,7 +1990,8 @@ def implement_corrective_action(
|
|||||||
try:
|
try:
|
||||||
log(preventing_oom_message)
|
log(preventing_oom_message)
|
||||||
except UnboundLocalError:
|
except UnboundLocalError:
|
||||||
preventing_oom_message = key
|
pass
|
||||||
|
# preventing_oom_message = key
|
||||||
|
|
||||||
if not vwd:
|
if not vwd:
|
||||||
if victim_id not in v_dict:
|
if victim_id not in v_dict:
|
||||||
|
Loading…
Reference in New Issue
Block a user