def config_monitor():
old_config = utils.read_file_text('config.json')
if not len(old_config):
logger.error("Could not read config.json file... not starting config monitor")
return
try:
mod_time = os.path.getmtime('config.json')
logger.debug("Started config monitor for config.json")
while True:
time.sleep(60)
if os.path.getmtime('config.json') != mod_time:
logger.debug("config.json was modified, restarting in 3 seconds...")
time.sleep(3)
os.kill(os.getppid(), signal.SIGHUP)
except Exception as ex:
logger.exception("Exception occurred: ")
############################################################
# PROCESS STUFF
############################################################
评论列表
文章目录