diff options
author | friendica <info@friendica.com> | 2012-05-07 15:54:49 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-05-07 15:54:49 -0700 |
commit | 189a31e6287781e03a874b13e27dedefe2beedf3 (patch) | |
tree | e151365d584ea12cadd06b1114492cef620cbdc4 /include/diaspora.php | |
parent | e8b9b8a403f4b13ed1548c3a8e616cadcd65e43e (diff) | |
download | volse-hubzilla-189a31e6287781e03a874b13e27dedefe2beedf3.tar.gz volse-hubzilla-189a31e6287781e03a874b13e27dedefe2beedf3.tar.bz2 volse-hubzilla-189a31e6287781e03a874b13e27dedefe2beedf3.zip |
If a contact has had delivery issues in the last 15 minutes, send new posts straight to the queue
and don't even try to connect. Also defer polling for stuck contacts. Should reduce the number of
stuck processes trying to connect with dead or dying servers significantly.
Diffstat (limited to 'include/diaspora.php')
-rw-r--r-- | include/diaspora.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/include/diaspora.php b/include/diaspora.php index 5069c1127..2051de5fc 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -2298,14 +2298,20 @@ function diaspora_transmit($owner,$contact,$slap,$public_batch) { logger('diaspora_transmit: ' . $logid . ' ' . $dest_url); - if(! intval(get_config('system','diaspora_test'))) - post_url($dest_url . '/', $slap); + if(was_recently_delayed($contact['id'])) { + $return_code = 0; + } else { - logger('diaspora_transmit: test_mode'); - return 200; + if(! intval(get_config('system','diaspora_test'))) { + post_url($dest_url . '/', $slap); + $return_code = $a->get_curl_code(); + } + else { + logger('diaspora_transmit: test_mode'); + return 200; + } } - - $return_code = $a->get_curl_code(); + logger('diaspora_transmit: ' . $logid . ' returns: ' . $return_code); if((! $return_code) || (($return_code == 503) && (stristr($a->get_curl_headers(),'retry-after')))) { |