// Handling the pubsubhubbub requests
Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], 'PubSubPublish');
- $r = dba::inArray(dba::p("SELECT `id` FROM `queue` WHERE `next` < UTC_TIMESTAMP()"));
+ $r = dba::inArray(dba::p("SELECT `id` FROM `queue` WHERE `next` < UTC_TIMESTAMP() ORDER BY `batch`, `cid`"));
Addon::callHooks('queue_predeliver', $r);
logger("Check server " . $server . " (" . $contact["network"] . ")");
$vital = PortableContact::checkServer($server, $contact["network"], true);
- Cache::set($cachekey_server . $server, $vital, CACHE_QUARTER_HOUR);
+ Cache::set($cachekey_server . $server, $vital, CACHE_MINUTE);
}
if (!is_null($vital) && !$vital) {
QueueModel::removeItem($q_item['id']);
} else {
QueueModel::updateTime($q_item['id']);
- Cache::set($cachekey_deadguy . $contact['notify'], true, CACHE_QUARTER_HOUR);
+ Cache::set($cachekey_deadguy . $contact['notify'], true, CACHE_MINUTE);
}
break;
case NETWORK_OSTATUS:
if ($deliver_status == -1) {
QueueModel::updateTime($q_item['id']);
- Cache::set($cachekey_deadguy . $contact['notify'], true, CACHE_QUARTER_HOUR);
+ Cache::set($cachekey_deadguy . $contact['notify'], true, CACHE_MINUTE);
} else {
QueueModel::removeItem($q_item['id']);
}
logger('queue: diaspora_delivery: item ' . $q_item['id'] . ' for ' . $contact['name'] . ' <' . $contact['url'] . '>');
$deliver_status = Diaspora::transmit($owner, $contact, $data, $public, true, 'Queue:' . $q_item['id'], true);
- if (($deliver_status >= 200) && ($deliver_status <= 299)) {
+ if ((($deliver_status >= 200) && ($deliver_status <= 299)) ||
+ ($contact['contact-type'] == ACCOUNT_TYPE_RELAY)) {
QueueModel::removeItem($q_item['id']);
} else {
QueueModel::updateTime($q_item['id']);
- Cache::set($cachekey_deadguy . $contact['notify'], true, CACHE_QUARTER_HOUR);
+ Cache::set($cachekey_deadguy . $contact['notify'], true, CACHE_MINUTE);
}
break;