3 if (!defined('GNUSOCIAL')) { exit(1); }
6 * Poll a feed based on its urlhash, the full url is in the feedsub table
8 * @author Mikael Nordfeldth <mmn@hethane.se>
10 class FeedPollQueueHandler extends QueueHandler
12 public function transport()
14 return FeedPoll::QUEUE_CHECK;
17 public function handle($item)
19 common_debug('Enqueueing FeedPoll feeds but actually running the queue handler!');
20 $feedsub = FeedSub::getKV('id', $item['id']);
21 if (!$feedsub instanceof FeedSub) {
22 // Removed from the feedsub table I guess
25 if (!$feedsub->sub_state == 'nohub') {
26 // We're not supposed to poll this (either it's PuSH or it's unsubscribed)
30 common_debug('Enqueueing FeedPoll feeds but actually checking updates');
32 FeedPoll::checkUpdates($feedsub);
33 } catch (Exception $e) {
34 common_log(LOG_ERR, "Failed to check feedsub id= ".$feedsub->id.' ("'.$e->getMessage().'")');
37 common_debug('Enqueueing FeedPoll feeds but actually done with '.$feedsub->id);