making restart state file more generic. make logs less noisy. put sleep in code so ovenwatcher can be set

This commit is contained in:
jbruce
2022-06-21 15:53:34 -04:00
parent 7f5b1396b6
commit fddf22e6bf
2 changed files with 8 additions and 2 deletions
+3 -1
View File
@@ -328,7 +328,8 @@ class Oven(threading.Thread):
if not config.automatic_restarts == True:
return False
if self.state_file_is_old():
log.info("restart not possible. state file too old.")
# this log statement is too noisy.
#log.info("restart not possible. state file too old.")
return False
if os.path.isfile(config.automatic_restart_state_file):
with open(config.automatic_restart_state_file) as infile: d = json.load(infile)
@@ -352,6 +353,7 @@ class Oven(threading.Thread):
profile_json = json.dumps(json.load(infile))
profile = Profile(profile_json)
self.run_profile(profile,startat=startat)
time.sleep(1)
self.ovenwatcher.record(profile)
def set_ovenwatcher(self,watcher):