]> git.mxchange.org Git - friendica.git/commitdiff
more optimising when confronted with dead servers
authorFriendika <info@friendika.com>
Fri, 26 Nov 2010 02:50:28 +0000 (18:50 -0800)
committerFriendika <info@friendika.com>
Fri, 26 Nov 2010 02:50:28 +0000 (18:50 -0800)
include/poller.php
mod/pubsub.php

index bc7fc5bb0c5716b791abcdaa749c95af7146aae8..d97584ff900c8ec45881913d69aae23374bc0a0d 100644 (file)
                                // mean the software was uninstalled or the domain expired. 
                                // Will keep trying for one month.
                                mark_for_death($contact);
+
+                               // set the last-update so we don't keep polling
+
+                               $r = q("UPDATE `contact` SET `last-update` = '%s' WHERE `id` = %d LIMIT 1",
+                                       dbesc(datetime_convert()),
+                                       intval($contact['id'])
+                               );
+
                                continue;
                        }
 
 
                        if(intval($res->status) == 1) {
                                logger("poller: $url replied status 1 - marking for death ");
+
                                // we may not be friends anymore. Will keep trying for one month.
+                               // set the last-update so we don't keep polling
+
+                               $r = q("UPDATE `contact` SET `last-update` = '%s' WHERE `id` = %d LIMIT 1",
+                                       dbesc(datetime_convert()),
+                                       intval($contact['id'])
+                               );
+
                                mark_for_death($contact);
                        }
                        else {
index c55100c96a3a5b54cc323d645012e72a3e9a0539..4f4ed2f16338e6928f14fb8b3c5be7b5b7b2c480 100644 (file)
@@ -39,7 +39,8 @@ function pubsub_init(&$a) {
                $hub_lease     = ((x($_GET,'hub_lease_seconds')) ? notags(trim($_GET['hub_lease_seconds'])) : '');
                $hub_verify    = ((x($_GET,'hub_verify_token'))  ? notags(trim($_GET['hub_verify_token']))  : '');
 
-               logger('pubsub: Subscription from' . $_SERVER['REMOTE_ADDR'] . print_r($_GET,true));
+               logger('pubsub: Subscription from ' . $_SERVER['REMOTE_ADDR']);
+               logger('pubsub: data: ' . print_r($_GET,true), LOGGER_DATA);
 
                $subscribe = (($hub_mode === 'subscribe') ? 1 : 0);