Warning: session_start(): open(/var/lib/php/sessions/sess_9s17dvo3d8j03c445vu59ag9c3, 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
sbool serverMechList_raw_fresh_verbose;
static S serverMechList_raw_fresh(S name) {
ret serverMechList_raw_fresh(name, false);
}
static S serverMechList_raw_fresh(S name, bool opt) {
lock downloadLock();
if (serverMechList_raw_fresh_verbose)
print("serverMechList_raw_fresh " + name);
S text = null;
pcall { text = loadTextFile(remoteMechListMirrorFile(name)); }
O[] params = muricaCredentialsPlus(md5 := md5OrNull(text), opt := opt ? 1 : 0);
S url = "http://butter.botcompany.de:8080/mech/raw/list-text/" + urlencode(name);
S page = postPageSilently(url, params);
Map map = jsonDecodeMap(page);
bool same = eq(map.get("Same"), true);
if (serverMechList_raw_fresh_verbose)
print("Mech list " + name + ": " + (same ? "same" : "downloaded"));
if (same) ret text;
text = (S) map.get("Text");
saveTextFile(remoteMechListMirrorFile(name), text);
File nameFile = remoteMechListMirrorNameFile(name);
if (!fileExists(nameFile)) {
S actualName = or((S) map.get("Name"), name);
saveTextFile(nameFile, actualName);
}
ret text;
}