You are here

function feeds_reschedule in Feeds 7

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

Reschedule one or all importers.

Note: feeds_reschedule() is used in update hook feeds_update_6012() and as such must be maintained as part of the upgrade path from pre 6.x 1.0 beta 6 versions of Feeds.

Parameters

$importer_id: If TRUE, all importers will be rescheduled, if FALSE, no importers will be rescheduled, if an importer id, only importer of that id will be rescheduled.

Return value

TRUE if all importers need rescheduling. FALSE if no rescheduling is required. An array of importers that need rescheduling.

Related topics

5 calls to feeds_reschedule()
FeedsImporter::configFormSubmit in includes/FeedsImporter.inc
Reschedule if import period changes.
FeedsImporter::delete in includes/FeedsImporter.inc
Delete configuration. Removes configuration information from database, does not delete configuration itself.
FeedsNodeProcessor::configFormSubmit in plugins/FeedsNodeProcessor.inc
Reschedule if expiry time changes.
feeds_cron in ./feeds.module
Implements hook_cron().
feeds_update_6012 in ./feeds.install
Drop schedule table and reschedule all tasks, install Job Scheduler module.

File

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

Code

function feeds_reschedule($importer_id = NULL) {
  $reschedule = variable_get('feeds_reschedule', FALSE);
  if ($importer_id === TRUE || $importer_id === FALSE) {
    $reschedule = $importer_id;
  }
  elseif (is_string($importer_id) && $reschedule !== TRUE) {
    $reschedule = is_array($reschedule) ? $reschedule : array();
    $reschedule[$importer_id] = $importer_id;
  }
  variable_set('feeds_reschedule', $reschedule);
  if ($reschedule === TRUE) {
    return feeds_enabled_importers();
  }
  return $reschedule;
}