This is just for me since my fan is broken

This commit is contained in:
Andrew Hamilton 2015-12-19 09:38:12 +00:00
parent 47378715d0
commit bbbe0aaeb6

14
vigil
View file

@ -847,6 +847,19 @@ class Screen:
({"w"}, toggle_watch_filesystem), ({"q"}, quit_)]
def get_cpu_temperature():
with open("/sys/class/thermal/thermal_zone0/temp", "r") as temp_file:
return int(temp_file.read()[:-4])
def regulate_temperature(log):
if get_cpu_temperature() >= 72:
log.log_message("The computer is too hot. Waiting to cool down...")
while get_cpu_temperature() > 66:
time.sleep(1)
log.log_message("The computer has cooled down. Continuing...")
class Runner:
def __init__(self):
@ -858,6 +871,7 @@ class Runner:
while True:
jobs_added_event.wait()
while self.is_running:
# regulate_temperature(log) # My fan is broken
try:
self.result = summary.get_closest_placeholder()
except StopIteration: