aboutsummaryrefslogtreecommitdiffstats
path: root/include/queue.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-12-16 22:42:33 -0800
committerredmatrix <redmatrix@redmatrix.me>2015-12-16 22:42:33 -0800
commit4cacfe59bd2f2d3b41ec9173b9310039971a76c8 (patch)
treeb8c29d6e283e2391923b20c9515a52a1fa652388 /include/queue.php
parentb909c878b1a58b055935a797d2a062b22ffc4315 (diff)
downloadvolse-hubzilla-4cacfe59bd2f2d3b41ec9173b9310039971a76c8.tar.gz
volse-hubzilla-4cacfe59bd2f2d3b41ec9173b9310039971a76c8.tar.bz2
volse-hubzilla-4cacfe59bd2f2d3b41ec9173b9310039971a76c8.zip
queue/notification/delivery refactor continued
Diffstat (limited to 'include/queue.php')
-rw-r--r--include/queue.php51
1 files changed, 1 insertions, 50 deletions
diff --git a/include/queue.php b/include/queue.php
index 5c3376661..8a3b2aa58 100644
--- a/include/queue.php
+++ b/include/queue.php
@@ -18,11 +18,8 @@ function queue_run($argv, $argc){
else
$queue_id = 0;
- $deadguys = array();
-
logger('queue: start');
-
// delete all queue items more than 3 days old
// but first mark these sites dead if we haven't heard from them in a month
@@ -88,53 +85,7 @@ function queue_run($argv, $argc){
return;
foreach($r as $rr) {
-
- $dresult = null;
-
- if(in_array($rr['outq_posturl'],$deadguys))
- continue;
-
- $base = '';
- $h = parse_url($rr['outq_posturl']);
- if($h)
- $base = $h['scheme'] . '://' . $h['host'] . (($h['port']) ? ':' . $h['port'] : '');
-
- if($rr['outq_driver'] === 'post') {
- $result = z_post_url($rr['outq_posturl'],$rr['outq_msg']);
- if($result['success'] && $result['return_code'] < 300) {
- logger('queue: queue post success to ' . $rr['outq_posturl'], LOGGER_DEBUG);
- if($base) {
- q("update site set site_update = '%s', site_dead = 0 where site_url = '%s' ",
- dbesc(datetime_convert()),
- dbesc($base)
- );
- }
- q("update dreport set dreport_result = '%s', dreport_time = '%s' where dreport_queue = '%s' limit 1",
- dbesc('accepted for delivery'),
- dbesc(datetime_convert()),
- dbesc($rr['outq_hash'])
- );
- remove_queue_item($rr['outq_hash']);
- }
- else {
- logger('queue: queue post returned ' . $result['return_code'] . ' from ' . $rr['outq_posturl'],LOGGER_DEBUG);
- update_queue_item($rr['outq_hash'],10);
- $deadguys[] = $rr['outq_posturl'];
- }
- continue;
- }
-
-
- $result = zot_zot($rr['outq_posturl'],$rr['outq_notify']);
- if($result['success']) {
- logger('queue: deliver zot success to ' . $rr['outq_posturl'], LOGGER_DEBUG);
- zot_process_response($rr['outq_posturl'],$result, $rr);
- }
- else {
- $deadguys[] = $rr['outq_posturl'];
- logger('queue: deliver zot returned ' . $result['return_code'] . ' from ' . $rr['outq_posturl'],LOGGER_DEBUG);
- update_queue_item($rr['outq_hash'],10);
- }
+ queue_deliver($rr);
}
}