aboutsummaryrefslogtreecommitdiffstats
path: root/include/queue_fn.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-05-07 15:54:49 -0700
committerfriendica <info@friendica.com>2012-05-07 15:54:49 -0700
commit189a31e6287781e03a874b13e27dedefe2beedf3 (patch)
treee151365d584ea12cadd06b1114492cef620cbdc4 /include/queue_fn.php
parente8b9b8a403f4b13ed1548c3a8e616cadcd65e43e (diff)
downloadvolse-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/queue_fn.php')
-rw-r--r--include/queue_fn.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/queue_fn.php b/include/queue_fn.php
index 3c1087f4e..613571c84 100644
--- a/include/queue_fn.php
+++ b/include/queue_fn.php
@@ -15,6 +15,15 @@ function remove_queue_item($id) {
);
}
+function was_recently_delayed($cid) {
+
+ $r = q("SELECT `id` FROM `queue` WHERE `cid` = %d
+ and last > UTC_TIMESTAMP() - interval 15 minute limit 1",
+ intval($cid)
+ );
+
+}
+
function add_to_queue($cid,$network,$msg,$batch = false) {