provide last successful poll run time (using relative time) in siteinfo so that we can tell folks that have no idea what we're talking about that their poller definitely isn't running and this is probably why nothing works correctly.

This commit is contained in:
friendica 2014-12-21 18:40:25 -08:00
parent b840c27995
commit d3830aea96
5 changed files with 21 additions and 7 deletions

View File

@ -2171,3 +2171,13 @@ function get_directory_realm() {
return DIRECTORY_REALM; return DIRECTORY_REALM;
} }
/**
* @brief return relative date of last completed poller execution
*/
function get_poller_runtime() {
$t = get_config('system','lastpoll');
return relative_date($t);
}

View File

@ -368,11 +368,6 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
$Text = preg_replace_callback("/\[pre\](.*?)\[\/pre\]/ism", 'bb_spacefy',$Text); $Text = preg_replace_callback("/\[pre\](.*?)\[\/pre\]/ism", 'bb_spacefy',$Text);
} }
// Not yet implemented - thinking this should display a map or perhaps be a map directive
// if (strpos($Text,'[location]') !== false) {
// $Text = preg_replace_callback("/\[location\](.*?)\[\/location\]/ism", 'bb_location',$Text);
// }
// If we find any event code, turn it into an event. // If we find any event code, turn it into an event.

View File

@ -403,6 +403,8 @@ function poller_run($argv, $argc){
} }
} }
set_config('system','lastpoll',datetime_convert());
//All done - clear the lockfile //All done - clear the lockfile
@unlink($lockfile); @unlink($lockfile);

View File

@ -73,6 +73,7 @@ function siteinfo_init(&$a) {
'site_name' => (($site_name) ? $site_name : ''), 'site_name' => (($site_name) ? $site_name : ''),
'platform' => RED_PLATFORM, 'platform' => RED_PLATFORM,
'dbdriver' => $db->getdriver(), 'dbdriver' => $db->getdriver(),
'lastpoll' => get_poller_runtime(),
'info' => (($site_info) ? $site_info : ''), 'info' => (($site_info) ? $site_info : ''),
'channels_total' => $channels_total_stat, 'channels_total' => $channels_total_stat,
'channels_active_halfyear' => $channels_active_halfyear_stat, 'channels_active_halfyear' => $channels_active_halfyear_stat,
@ -134,10 +135,13 @@ function siteinfo_content(&$a) {
'$title' => t('Red'), '$title' => t('Red'),
'$description' => t('This is a hub of the Red Matrix - a global cooperative network of decentralized privacy enhanced websites.'), '$description' => t('This is a hub of the Red Matrix - a global cooperative network of decentralized privacy enhanced websites.'),
'$version' => $version, '$version' => $version,
'$tag_txt' => t('Tag: '),
'$tag' => $tag, '$tag' => $tag,
'$polled' => t('Last background fetch: '),
'$lastpoll' => get_poller_runtime(),
'$commit' => $commit, '$commit' => $commit,
'$web_location' => t('Running at web location') . ' ' . z_root(), '$web_location' => t('Running at web location') . ' ' . z_root(),
'$visit' => t('Please visit <a href="http://getzot.com">GetZot.com</a> to learn more about the Red Matrix.'), '$visit' => t('Please visit <a href="https://redmatrix.me">RedMatrix.me</a> to learn more about the Red Matrix.'),
'$bug_text' => t('Bug reports and issues: please visit'), '$bug_text' => t('Bug reports and issues: please visit'),
'$bug_link_url' => 'https://github.com/friendica/red/issues', '$bug_link_url' => 'https://github.com/friendica/red/issues',
'$bug_link_text' => 'redmatrix issues', '$bug_link_text' => 'redmatrix issues',

View File

@ -5,7 +5,10 @@
<p>{{$version}}{{if $commit}}+{{$commit}}{{/if}}</p> <p>{{$version}}{{if $commit}}+{{$commit}}{{/if}}</p>
{{/if}} {{/if}}
{{if $tag}} {{if $tag}}
<p>Tag: {{$tag}}</p> <p>{{$tag_txt}} {{$tag}}</p>
{{/if}}
{{if $polled}}
<p>{{$polled}} {{$lastpoll}}</p>
{{/if}} {{/if}}
<p>{{$web_location}}</p> <p>{{$web_location}}</p>
<p>{{$visit}}</p> <p>{{$visit}}</p>