diff options
author | zotlabs <mike@macgirvin.com> | 2017-11-02 17:31:49 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-11-02 17:31:49 -0700 |
commit | 0403738981487b7edec20b11a85849254366a202 (patch) | |
tree | 7e713b118be1d581cd4bb2c59d8b23d4b20943ea /include/zot.php | |
parent | f23c8e7597b6d96639738d0180e8cb277682ce23 (diff) | |
parent | 8f59b2d3e03b579d62efce9067acbcd32c5ac2b5 (diff) | |
download | volse-hubzilla-0403738981487b7edec20b11a85849254366a202.tar.gz volse-hubzilla-0403738981487b7edec20b11a85849254366a202.tar.bz2 volse-hubzilla-0403738981487b7edec20b11a85849254366a202.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'include/zot.php')
-rw-r--r-- | include/zot.php | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/include/zot.php b/include/zot.php index 5270ed8b8..5764bb99a 100644 --- a/include/zot.php +++ b/include/zot.php @@ -285,6 +285,16 @@ function zot_refresh($them, $channel = null, $force = false) { return false; } + $s = q("select site_dead from site where site_url = '%s' limit 1", + dbesc($url) + ); + + if($s && intval($s[0]['site_dead']) && (! $force)) { + logger('zot_refresh: site ' . $url . ' is marked dead and force flag is not set. Cancelling operation.'); + return false; + } + + $token = random_string(); $postvars = []; @@ -3138,6 +3148,15 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) { 'msg' => json_encode($info) )); + + $x = q("select count(outq_hash) as total from outq where outq_delivered = 0"); + if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300))) { + logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO); + update_queue_item($hash); + continue; + } + + Zotlabs\Daemon\Master::Summon(array('Deliver', $hash)); $total = $total - 1; @@ -3872,7 +3891,7 @@ function zot_reply_message_request($data) { if ($messages) { $env_recips = null; - $r = q("select hubloc.*, site.site_crypto from hubloc left join site on hubloc_url = site_url where hubloc_hash = '%s' and hubloc_error = 0 and hubloc_deleted = 0", + $r = q("select hubloc.*, site.site_crypto from hubloc left join site on hubloc_url = site_url where hubloc_hash = '%s' and hubloc_error = 0 and hubloc_deleted = 0 and site.site_dead = 0 ", dbesc($sender_hash) ); if (! $r) { @@ -3905,6 +3924,14 @@ function zot_reply_message_request($data) { 'msg' => $data_packet )); + + $x = q("select count(outq_hash) as total from outq where outq_delivered = 0"); + if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300))) { + logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO); + update_queue_item($hash); + continue; + } + /* * invoke delivery to send out the notify packet */ |