<?php
-use \Friendica\Core\Config;
+
+use Friendica\App;
+use Friendica\Core\Config;
require_once('include/items.php');
require_once('include/ostatus.php');
function pubsubpublish_run(&$argv, &$argc){
+ global $a;
if ($argc > 1) {
$pubsubpublish_id = intval($argv[1]);
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"]);
}
}
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']);
// 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,