You are here

function feeds_cron in Feeds 7

Same name and namespace in other branches
  1. 8.3 feeds.module \feeds_cron()
  2. 8.2 feeds.module \feeds_cron()
  3. 6 feeds.module \feeds_cron()
  4. 7.2 feeds.module \feeds_cron()

Implements hook_cron().

Related topics

File

./feeds.module, line 28
Feeds - basic API functions and hook implementations.

Code

function feeds_cron() {
  if ($importers = feeds_reschedule()) {
    foreach ($importers as $id) {
      feeds_importer($id)
        ->schedule();
      $rows = db_query("SELECT feed_nid FROM {feeds_source} WHERE id = :id", array(
        ':id' => $id,
      ));
      foreach ($rows as $row) {
        feeds_source($id, $row->feed_nid)
          ->schedule();
      }
    }
    feeds_reschedule(FALSE);
    return;
  }
}