X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fpubsubpublish.php;h=580e3ffce18038f8b86f521f28acdf2d54a80aaf;hb=0cd9db9cb7f4c96f597e37590a536eaae123238d;hp=05e93b864c833cbdfc74008fdc8c31ad29e89f1e;hpb=41a36606c6ee92c914acbb7f6d9ea79c0a149088;p=friendica.git diff --git a/include/pubsubpublish.php b/include/pubsubpublish.php index 05e93b864c..580e3ffce1 100644 --- a/include/pubsubpublish.php +++ b/include/pubsubpublish.php @@ -1,10 +1,13 @@ 1) { $pubsubpublish_id = intval($argv[1]); @@ -15,7 +18,8 @@ function pubsubpublish_run(&$argv, &$argc){ foreach ($r as $rr) { logger("Publish feed to ".$rr["callback_url"], LOGGER_DEBUG); - proc_run(PRIORITY_HIGH, 'include/pubsubpublish.php', $rr["id"]); + proc_run(array('priority' => PRIORITY_HIGH, 'created' => $a->queue['created'], 'dont_fork' => true), + 'include/pubsubpublish.php', (int)$rr["id"]); } } @@ -28,13 +32,15 @@ function handle_pubsubhubbub($id) { global $a; $r = q("SELECT * FROM `push_subscriber` WHERE `id` = %d", intval($id)); - if (!dbm::is_result($r)) { return; } $rr = $r[0]; + /// @todo Check server status with poco_check_server() + // Before this can be done we need a way to safely detect the server url. + logger("Generate feed of user ".$rr['nickname']." to ".$rr['callback_url']." - last updated ".$rr['last_update'], LOGGER_DEBUG); $params = ostatus::feed($a, $rr['nickname'], $rr['last_update']); @@ -67,10 +73,8 @@ function handle_pubsubhubbub($id) { // increment this until some upper limit where we give up $new_push = intval($rr['push']) + 1; - if ($new_push > 30) { - // OK, let's give up + if ($new_push > 30) // OK, let's give up $new_push = 0; - } q("UPDATE `push_subscriber` SET `push` = %d WHERE id = %d", $new_push,