$orig = clone($feedsub);
$item = array('id' => $feedsub->id);
$qm->enqueue($item, self::QUEUE_CHECK);
- common_debug('Enqueueing FeedPoll feeds, currently: '.$feedsub->uri);
$feedsub->last_update = common_sql_now();
$feedsub->update($orig);
}
public function checkUpdates(FeedSub $feedsub)
{
$request = new HTTPClient();
- common_debug('Enqueueing FeedPoll feeds went well, now checking updates for: '.$feedsub->getUri());
$feed = $request->get($feedsub->uri);
if (!$feed->isOk()) {
throw new ServerException('FeedSub could not fetch id='.$feedsub->id.' (Error '.$feed->getStatus().': '.$feed->getBody());
public function handle($item)
{
- common_debug('Enqueueing FeedPoll feeds but actually running the queue handler!');
$feedsub = FeedSub::getKV('id', $item['id']);
if (!$feedsub instanceof FeedSub) {
// Removed from the feedsub table I guess
return true;
}
- common_debug('Enqueueing FeedPoll feeds but actually checking updates');
try {
FeedPoll::checkUpdates($feedsub);
} catch (Exception $e) {
common_log(LOG_ERR, "Failed to check feedsub id= ".$feedsub->id.' ("'.$e->getMessage().'")');
}
- common_debug('Enqueueing FeedPoll feeds but actually done with '.$feedsub->id);
-
return true;
}
}