X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fnotifier.php;h=a08057f6772fa49611bb79f9fb29cec0f9f35ffb;hb=34815de99c548b61c94b6e6939edd485eca728d6;hp=e3d7d10d6b2a7595e76143eaf60ae4cf4b6e78d3;hpb=4812f4c0f93915c20e4b3a9727fe0535a9d72721;p=friendica.git diff --git a/include/notifier.php b/include/notifier.php index e3d7d10d6b..a08057f677 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -1,13 +1,14 @@ getmypid()), array('limit' => 1)); + if (dbm::is_result($queue)) { + $priority = (int)$queue['priority']; + logger('inherited priority: '.$priority); + } else { + // Normally this shouldn't happen. + $priority = PRIORITY_HIGH; + logger('no inherited priority! Something is wrong.'); + } + logger('notifier: invoked: ' . print_r($argv,true), LOGGER_DEBUG); $cmd = $argv[1]; @@ -138,7 +150,7 @@ function notifier_run(&$argv, &$argc){ if (!$r) { return; } - require_once('include/Contact.php'); + require_once 'include/Contact.php'; foreach ($r as $contact) { terminate_friendship($user, $self, $contact); } @@ -222,7 +234,7 @@ function notifier_run(&$argv, &$argc){ $slap = ostatus::salmon($target_item,$owner); - require_once('include/group.php'); + require_once 'include/group.php'; $parent = $items[0]; @@ -347,7 +359,7 @@ function notifier_run(&$argv, &$argc){ // a delivery fork. private groups (forum_mode == 2) do not uplink if ((intval($parent['forum_mode']) == 1) && (! $top_level) && ($cmd !== 'uplink')) { - proc_run(PRIORITY_HIGH,'include/notifier.php','uplink',$item_id); + proc_run($priority, 'include/notifier.php', 'uplink', $item_id); } $conversants = array(); @@ -486,7 +498,7 @@ function notifier_run(&$argv, &$argc){ } logger("Deliver ".$target_item["guid"]." to ".$contact['url']." via network ".$contact['network'], LOGGER_DEBUG); - proc_run(PRIORITY_HIGH,'include/delivery.php', $cmd, $item_id, $contact['id']); + proc_run(array('priority' => $priority, 'dont_fork' => true), 'include/delivery.php', $cmd, $item_id, $contact['id']); } } @@ -516,7 +528,8 @@ function notifier_run(&$argv, &$argc){ $r0 = Diaspora::relay_list(); } - $r1 = q("SELECT DISTINCT(`batch`), `id`, `name`,`network` FROM `contact` WHERE `network` = '%s' + $r1 = q("SELECT `batch`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`name`) AS `name`, ANY_VALUE(`network`) AS `network` + FROM `contact` WHERE `network` = '%s' AND `uid` = %d AND `rel` != %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` GROUP BY `batch` ORDER BY rand()", dbesc(NETWORK_DIASPORA), intval($owner['uid']), @@ -550,7 +563,7 @@ function notifier_run(&$argv, &$argc){ if ((! $mail) && (! $fsuggest) && (! $followup)) { logger('notifier: delivery agent: '.$rr['name'].' '.$rr['id'].' '.$rr['network'].' '.$target_item["guid"]); - proc_run(PRIORITY_HIGH,'include/delivery.php',$cmd,$item_id,$rr['id']); + proc_run(array('priority' => $priority, 'dont_fork' => true), 'include/delivery.php', $cmd, $item_id, $rr['id']); } } } @@ -590,7 +603,7 @@ function notifier_run(&$argv, &$argc){ } // Handling the pubsubhubbub requests - proc_run(PRIORITY_HIGH,'include/pubsubpublish.php'); + proc_run(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), 'include/pubsubpublish.php'); } logger('notifier: calling hooks', LOGGER_DEBUG);