diff options
author | friendica <info@friendica.com> | 2015-03-04 17:56:07 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-03-04 17:56:07 -0800 |
commit | 011ccd57f62335c915b5ac75e20c45a36a64a888 (patch) | |
tree | c79340ecdbe9dfc41fcb9d11798620f6b59c4fdb /include/deliver.php | |
parent | 410f3335a9e97276b3262196f50798ff56624af5 (diff) | |
download | volse-hubzilla-011ccd57f62335c915b5ac75e20c45a36a64a888.tar.gz volse-hubzilla-011ccd57f62335c915b5ac75e20c45a36a64a888.tar.bz2 volse-hubzilla-011ccd57f62335c915b5ac75e20c45a36a64a888.zip |
add queue priority
Diffstat (limited to 'include/deliver.php')
-rw-r--r-- | include/deliver.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/deliver.php b/include/deliver.php index 47d8562df..459c0f94b 100644 --- a/include/deliver.php +++ b/include/deliver.php @@ -20,6 +20,24 @@ function deliver_run($argv, $argc) { dbesc($argv[$x]) ); if($r) { + $h = parse_url($r[0]['outq_posturl']); + if($h) { + $base = $h['scheme'] . '://' . $h['host'] . (($h['port']) ? ':' . $h['port'] : ''); + if($base !== z_root()) { + $x = q("select site_update from site where site_url = '%s' ", + dbesc($base) + ); + if($x && $x[0]['site_update'] < datetime_convert('UTC','UTC','now - 1 month')) { + q("update outq set outq_priority = %d where outq_hash = '%s'", + intval($r[0]['outq_priority'] + 10) + dbesc($r[0]['outq_hash']) + ); + logger('immediate delivery deferred for site ' . $base); + continue; + } + } + } + if($r[0]['outq_driver'] === 'post') { $result = z_post_url($r[0]['outq_posturl'],$r[0]['outq_msg']); if($result['success'] && $result['return_code'] < 300) { |