Split expire.php in several processes / small worker changes

This commit is contained in:
Michael 2017-07-06 05:48:02 +00:00
commit 30b0a035f9
8 changed files with 79 additions and 38 deletions

View file

@ -38,7 +38,7 @@ require_once 'include/Photo.php';
*/
function poco_load($cid, $uid = 0, $zcid = 0, $url = null) {
// Call the function "poco_load_worker" via the worker
proc_run(PRIORITY_LOW, "include/discover_poco.php", "poco_load", intval($cid), intval($uid), intval($zcid), base64_encode($url));
proc_run(PRIORITY_LOW, "include/discover_poco.php", "poco_load", (int)$cid, (int)$uid, (int)$zcid, $url);
}
/**
@ -1668,7 +1668,7 @@ function poco_fetch_serverlist($poco) {
$r = q("SELECT `nurl` FROM `gserver` WHERE `nurl` = '%s'", dbesc(normalise_link($server_url)));
if (!dbm::is_result($r)) {
logger("Call server check for server ".$server_url, LOGGER_DEBUG);
proc_run(PRIORITY_LOW, "include/discover_poco.php", "server", base64_encode($server_url));
proc_run(PRIORITY_LOW, "include/discover_poco.php", "server", $server_url);
}
}
}
@ -1690,7 +1690,7 @@ function poco_discover_federation() {
$servers = json_decode($serverdata);
foreach ($servers->pods as $server) {
proc_run(PRIORITY_LOW, "include/discover_poco.php", "server", base64_encode("https://".$server->host));
proc_run(PRIORITY_LOW, "include/discover_poco.php", "server", "https://".$server->host);
}
}
@ -1703,7 +1703,7 @@ function poco_discover_federation() {
foreach ($servers as $server) {
$url = (is_null($server->https_score) ? 'http' : 'https').'://'.$server->name;
proc_run(PRIORITY_LOW, "include/discover_poco.php", "server", base64_encode($url));
proc_run(PRIORITY_LOW, "include/discover_poco.php", "server", $url);
}
}
}
@ -1813,7 +1813,7 @@ function poco_discover($complete = false) {
}
logger('Update directory from server '.$server['url'].' with ID '.$server['id'], LOGGER_DEBUG);
proc_run(PRIORITY_LOW, "include/discover_poco.php", "update_server_directory", intval($server['id']));
proc_run(PRIORITY_LOW, "include/discover_poco.php", "update_server_directory", (int)$server['id']);
if (!$complete && (--$no_of_queries == 0)) {
break;
@ -2091,7 +2091,7 @@ function get_gcontact_id($contact) {
if ($doprobing) {
logger("Last Contact: ". $last_contact_str." - Last Failure: ".$last_failure_str." - Checking: ".$contact["url"], LOGGER_DEBUG);
proc_run(PRIORITY_LOW, 'include/gprobe.php', bin2hex($contact["url"]));
proc_run(PRIORITY_LOW, 'include/gprobe.php', $contact["url"]);
}
return $gcontact_id;