static double autoRestart_interval = 10; static bool autoRestart_on, autoRestart_debug; static void autoRestart() { if (autoRestart_on) ret; set autoRestart_on; autoRestart_schedule(); preloadProgramTitle(); } svoid autoRestart_schedule { doLater_daemon(toMS(autoRestart_interval), f autoRestart_check); } svoid autoRestart_check { try { S newMD5 = getServerTranspilationMD5(programID()); if (!isMD5(newMD5)) { if (autoRestart_debug) print("autoRestart: no server transpilation"); ret; } S localMD5 = md5(loadCachedTranspilation(programID())); if (neq(localMD5, newMD5)) { if (!hasServerDex(programID())) { if (autoRestart_debug) print("autoRestart: Compilation failed"); ret; } infoBox("Upgrading " + programTitle()); restartWithDelay(1000); sleep(); } } finally { if (autoRestart_debug) print("autoRestart: Done"); autoRestart_schedule(); } }