Warning: session_start(): open(/var/lib/php/sessions/sess_vaaqceb19jg30tn052fuvtk7d4, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
static double autoRestart_interval = 10;
static bool autoRestart_on, autoRestart_debug, autoRestart_simulate;
static java.util.Timer autoRestart_timer;
static void autoRestart(double interval) {
autoRestart_interval = interval;
autoRestart();
}
static void autoRestart() {
if (!isMain() || autoRestart_on) ret;
set autoRestart_on;
autoRestart_schedule();
preloadProgramTitle();
}
static void autoRestart_off() {
if (!autoRestart_on) ret;
stopTimer(autoRestart_timer);
autoRestart_timer = null;
}
svoid autoRestart_schedule {
autoRestart_timer = doLater_daemon(toMS(autoRestart_interval), f autoRestart_check);
}
svoid autoRestart_check {
try {
S newMD5;
try {
newMD5 = loadPageSilently("http://botcompany.de/1010693/raw?id=" + psI(programID()));
} catch e {
ret;
}
if (!isMD5(newMD5)) { if (autoRestart_debug) print("autoRestart: no server transpilation"); ret; }
if (autoRestart_localMD5 == null)
autoRestart_localMD5 = md5(loadCachedTranspilation(programID()));
S localMD5 = autoRestart_localMD5();
if (neq(localMD5, newMD5)) {
if (autoRestart_simulate)
print("Would upgrade now. " + localMD5 + " -> " + newMD5);
else {
infoBox("Upgrading " + programTitle());
restartWithDelay(1000);
sleep();
}
}
} finally {
if (autoRestart_debug) print("autoRestart: Done");
autoRestart_schedule();
}
}