Warning: session_start(): open(/var/lib/php/sessions/sess_9tgd7ckqjterhuogrgejhkmdjd, 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
!7
static int refreshDelay = 1; // seconds
// TODO: share transpiler
start {
set transpileRaw_dontCopyFromCreator;
}
html {
if (!webAuthed(params)) ret "not authed";
if (eqOneOf("1", params.get('medium), params.get('fresh))) {
refreshTranspiler();
print("Refreshed transpiler.");
}
uri = dropPrefixSlash(uri);
if (isSnippetID(uri)) params.put(snippetID := uri);
if (empty(params.get('snippetID))) ret "OK";
sendToSnippetUpdatesBot("/transpiling/" + params.get('snippetID));
final bool compile = eq("1", params.get('compile));
final new Flag ok;
S text = hijackPrint_tee(r {
S snippetID = fsI(params.get('snippetID));
pcall {
temp tempSetTL(transpileForServer_compile, compile);
transpileForServer(snippetID);
ok.raise();
}
});
S redirect = params.get('redirect);
sendToSnippetUpdatesBot("/transpile" + (ok.isUp() ? "OK" : "Fail")
+ "/" + psI(params.get('snippetID)));
ret hhtml(hhead(htitle((ok.isUp() ? "OK" : "Failed") + " Transpilation")
+ (ok.isUp() && nempty(redirect) ? hrefresh(refreshDelay, redirect) : ""))
+ hbody(hsourcecode(text)));
}