From 7a8399c44725ae0dd38cf2655088cb517ca4ec65 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 6 Feb 2014 00:23:08 +0100 Subject: [PATCH 1/2] statistics: auto-registering the server. --- statistics_json/statistics_json.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/statistics_json/statistics_json.php b/statistics_json/statistics_json.php index 526c5224b..6861b130b 100644 --- a/statistics_json/statistics_json.php +++ b/statistics_json/statistics_json.php @@ -42,11 +42,11 @@ function statistics_json_cron($a,$b) { $last = get_config('statistics_json','last_calucation'); if($last) { - // Calculate all 3 hours - $next = $last + (180 * 60); + // Calculate all 6 hours + $next = $last + (360 * 60); if($next > time()) { logger('statistics_json_cron: calculation intervall not reached'); - return; +// return; } } logger('statistics_json_cron: cron_start'); @@ -102,6 +102,12 @@ function statistics_json_cron($a,$b) { logger('statistics_json_cron: local_posts: '.$local_posts, LOGGER_DEBUG); + // Now trying to register + $url = "http://pods.jasonrobinson.me/register/".$a->get_hostname(); + logger('statistics_json_cron: registering url: '.$url, LOGGER_DEBUG); + $ret = fetch_url($url); + logger('statistics_json_cron: registering answer: '.$ret, LOGGER_DEBUG); + logger('statistics_json_cron: cron_end'); set_config('statistics_json','last_calucation', time()); } From 234b91a37b624f2e86284390274bc799abd2c5ef Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 6 Feb 2014 00:25:55 +0100 Subject: [PATCH 2/2] statistics: Args ... forgotten comment again. --- statistics_json/statistics_json.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/statistics_json/statistics_json.php b/statistics_json/statistics_json.php index 6861b130b..1fe96f515 100644 --- a/statistics_json/statistics_json.php +++ b/statistics_json/statistics_json.php @@ -46,7 +46,7 @@ function statistics_json_cron($a,$b) { $next = $last + (360 * 60); if($next > time()) { logger('statistics_json_cron: calculation intervall not reached'); -// return; + return; } } logger('statistics_json_cron: cron_start');