[twitter] Add logging for error conditions in twitter_fetchtimeline()
This commit is contained in:
parent
ed1de0cd18
commit
6822079a03
1 changed files with 16 additions and 12 deletions
|
@ -1257,15 +1257,20 @@ function twitter_fetchtimeline(App $a, int $uid)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($first_time) {
|
if ($first_time) {
|
||||||
|
Logger::warning('First time, continue');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stristr($post->source, $application_name)) {
|
if (stristr($post->source, $application_name)) {
|
||||||
|
Logger::warning('Source is application name', ['source' => $post->source, 'application_name' => $application_name]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Logger::info('Preparing mirror post', ['twitter-id' => $post->id_str, 'uid' => $uid]);
|
Logger::info('Preparing mirror post', ['twitter-id' => $post->id_str, 'uid' => $uid]);
|
||||||
|
|
||||||
$mirrorpost = twitter_do_mirrorpost($a, $uid, $post);
|
$mirrorpost = twitter_do_mirrorpost($a, $uid, $post);
|
||||||
|
|
||||||
if (empty($mirrorpost['body'])) {
|
if (empty($mirrorpost['body'])) {
|
||||||
|
Logger::warning('Body is empty', ['post' => $post, 'mirrorpost' => $mirrorpost]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1274,7 +1279,6 @@ function twitter_fetchtimeline(App $a, int $uid)
|
||||||
Post\Delayed::add($mirrorpost['extid'], $mirrorpost, PRIORITY_MEDIUM, Post\Delayed::UNPREPARED);
|
Post\Delayed::add($mirrorpost['extid'], $mirrorpost, PRIORITY_MEDIUM, Post\Delayed::UNPREPARED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
DI::pConfig()->set($uid, 'twitter', 'lastid', $lastid);
|
DI::pConfig()->set($uid, 'twitter', 'lastid', $lastid);
|
||||||
Logger::info('Last ID for user ' . $uid . ' is now ' . $lastid);
|
Logger::info('Last ID for user ' . $uid . ' is now ' . $lastid);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue