added some clarity for the logger

This commit is contained in:
Ben Liyanage 2014-09-25 12:49:23 -04:00
parent b141c2cff1
commit 9a26a253c9

View file

@ -158,7 +158,6 @@ function fbsync_settings_post(&$a,&$b) {
function fbsync_cron($a,$b) { function fbsync_cron($a,$b) {
$last = get_config('fbsync','last_poll'); $last = get_config('fbsync','last_poll');
$poll_interval = intval(get_config('fbsync','poll_interval')); $poll_interval = intval(get_config('fbsync','poll_interval'));
if(! $poll_interval) if(! $poll_interval)
$poll_interval = FBSYNC_DEFAULT_POLL_INTERVAL; $poll_interval = FBSYNC_DEFAULT_POLL_INTERVAL;
@ -166,13 +165,14 @@ function fbsync_cron($a,$b) {
if($last) { if($last) {
$next = $last + ($poll_interval * 60); $next = $last + ($poll_interval * 60);
if($next > time()) { if($next > time()) {
logger('fbsync_cron: poll intervall not reached'); logger('fbsync_cron: poll intervall not reached. poll interval: ' . $poll_interval * 60 . '; actual interval: ' . $poll_interval);
return; return;
} }
} }
logger('fbsync_cron: cron_start'); logger('fbsync_cron: cron_start');
$r = q("SELECT * FROM `pconfig` WHERE `cat` = 'fbsync' AND `k` = 'sync' AND `v` = '1' ORDER BY RAND()"); $r = q("SELECT * FROM `pconfig` WHERE `cat` = 'fbsync' AND `k` = 'sync' AND `v` = '1' ORDER BY RAND()");
if(count($r)) { if(count($r)) {
foreach($r as $rr) { foreach($r as $rr) {
fbsync_get_self($rr['uid']); fbsync_get_self($rr['uid']);
@ -443,16 +443,6 @@ function fbsync_createpost($a, $uid, $self, $contacts, $applications, $post, $cr
$postarray['allow_cid'] = '<' . $self[0]['id'] . '>'; $postarray['allow_cid'] = '<' . $self[0]['id'] . '>';
} }
/*
$postarray["location"] = $post->place->name;
postarray["coord"] = $post->geo->coordinates[0]." ".$post->geo->coordinates[1];
*/
//$types = array(46, 80, 237, 247, 308);
//if (!in_array($post->type, $types))
// $postarray["body"] = "Type: ".$post->type."\n".$postarray["body"];
//print_r($post);
//print_r($postarray);
$item = item_store($postarray); $item = item_store($postarray);
logger('fbsync_createpost: User '.$self[0]["nick"].' posted feed item '.$item, LOGGER_DEBUG); logger('fbsync_createpost: User '.$self[0]["nick"].' posted feed item '.$item, LOGGER_DEBUG);
} }