def maybe_restart_mirroring_script():
# type: () -> None
if os.stat(os.path.join(options.stamp_path, "stamps", "restart_stamp")).st_mtime > start_time or \
((options.user == "tabbott" or options.user == "tabbott/extra") and
os.stat(os.path.join(options.stamp_path, "stamps", "tabbott_stamp")).st_mtime > start_time):
logger.warning("")
logger.warning("zephyr mirroring script has been updated; restarting...")
maybe_kill_child()
try:
zephyr._z.cancelSubs()
except IOError:
# We don't care whether we failed to cancel subs properly, but we should log it
logger.exception("")
while True:
try:
os.execvp(os.path.abspath(__file__), sys.argv)
except Exception:
logger.exception("Error restarting mirroring script; trying again... Traceback:")
time.sleep(1)
评论列表
文章目录