From 99e4d2362c3e02f7ef593208a365d81254c25156 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 3 Mar 2015 15:54:38 -0800 Subject: I'm going to use the site_update timestamp to indicate whenever we successfully connect with a site. This way we can mark hubs dead on non-directory servers; but we have to wait before implementing this until we have a history of site_update being updated. --- include/zot.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/zot.php') diff --git a/include/zot.php b/include/zot.php index 29513b8c5..670583929 100644 --- a/include/zot.php +++ b/include/zot.php @@ -984,6 +984,14 @@ function zot_process_response($hub,$arr,$outq) { logger('zot_process_response: headers: ' . print_r($arr['header'],true), LOGGER_DATA); } + // update the timestamp for this site + + $r = q("update site set site_update = '%s' where site_url = '%s'", + dbesc(datetime_convert()), + dbesc(dirname($hub)) + ); + + // synchronous message types are handled immediately // async messages remain in the queue until processed. @@ -2585,6 +2593,13 @@ function import_site($arr,$pubkey) { logger('import_site: update failed. ' . print_r($arr,true)); } } + else { + // update the timestamp to indicate we communicated with this site + q("update site set site_update = '%s' where site_url = '%s'", + dbesc(datetime_convert()), + dbesc($url) + ); + } } else { $update = true; -- cgit v1.2.3