Merge pull request #5363 from annando/daemin
Workaround for stalling worker processes when running the daemon
This commit is contained in:
commit
26723623f4
|
@ -106,8 +106,10 @@ if (!$foreground) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(STDIN); // Close all of the standard
|
fclose(STDIN); // Close all of the standard
|
||||||
fclose(STDOUT); // file descriptors as we
|
|
||||||
fclose(STDERR); // are running as a daemon.
|
// Enabling this seem to block a running php process with 100% CPU usage when there is an outpout
|
||||||
|
// fclose(STDOUT); // file descriptors as we
|
||||||
|
// fclose(STDERR); // are running as a daemon.
|
||||||
|
|
||||||
dba::disconnect();
|
dba::disconnect();
|
||||||
|
|
||||||
|
|
|
@ -63,4 +63,3 @@ Worker::unclaimProcess();
|
||||||
Worker::endProcess();
|
Worker::endProcess();
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
|
|
||||||
|
|
|
@ -597,7 +597,7 @@ class Worker
|
||||||
['id' => $entry["id"]]
|
['id' => $entry["id"]]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
logger("Worker process ".$entry["pid"]." (".implode(" ", $argv).") now runs for ".round($duration)." of ".$max_duration." allowed minutes. That's okay.", LOGGER_DEBUG);
|
logger("Worker process ".$entry["pid"]." (".substr(json_encode($argv), 0, 50).") now runs for ".round($duration)." of ".$max_duration." allowed minutes. That's okay.", LOGGER_DEBUG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -564,15 +564,16 @@ class GContact
|
||||||
|
|
||||||
if (strlen(Config::get('system', 'directory'))) {
|
if (strlen(Config::get('system', 'directory'))) {
|
||||||
$x = Network::fetchUrl(get_server()."/pubsites");
|
$x = Network::fetchUrl(get_server()."/pubsites");
|
||||||
if ($x) {
|
if (!empty($x)) {
|
||||||
$j = json_decode($x);
|
$j = json_decode($x);
|
||||||
if ($j->entries) {
|
if (!empty($j->entries)) {
|
||||||
foreach ($j->entries as $entry) {
|
foreach ($j->entries as $entry) {
|
||||||
PortableContact::checkServer($entry->url);
|
PortableContact::checkServer($entry->url);
|
||||||
|
|
||||||
$url = $entry->url . '/poco';
|
$url = $entry->url . '/poco';
|
||||||
if (! in_array($url, $done)) {
|
if (!in_array($url, $done)) {
|
||||||
PortableContact::loadWorker(0, 0, 0, $entry->url . '/poco');
|
PortableContact::loadWorker(0, 0, 0, $url);
|
||||||
|
$done[] = $url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue