aggregator_cron

Versions
4.6 – 7
aggregator_cron()

Implement hook_cron().

Queues news feeds for updates once their refresh interval has elapsed.

Code

modules/aggregator/aggregator.module, line 321

<?php
function aggregator_cron() {
  $result = db_query('SELECT * FROM {aggregator_feed} WHERE checked + refresh < :time AND refresh != :never', array(
    ':time' => REQUEST_TIME,
    ':never' => AGGREGATOR_CLEAR_NEVER
  ));
  $queue = DrupalQueue::get('aggregator_feeds');
  foreach ($result as $feed) {
    $queue->createItem($feed);
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.