Skip to content
Snippets Groups Projects
Commit ba2fe1ed authored by Alex Barth's avatar Alex Barth
Browse files

Cleaning up unused functions.

parent c76bc9ed
No related branches found
No related tags found
No related merge requests found
...@@ -61,9 +61,6 @@ interface FeedsSchedulerInterface { ...@@ -61,9 +61,6 @@ interface FeedsSchedulerInterface {
*/ */
class FeedsScheduler implements FeedsSchedulerInterface { class FeedsScheduler implements FeedsSchedulerInterface {
// Only used for debugging.
protected $debugTime;
/** /**
* Create a single instance of FeedsScheduler. * Create a single instance of FeedsScheduler.
*/ */
...@@ -124,7 +121,7 @@ class FeedsScheduler implements FeedsSchedulerInterface { ...@@ -124,7 +121,7 @@ class FeedsScheduler implements FeedsSchedulerInterface {
// Refresh feeds that have a refresh time older than now minus // Refresh feeds that have a refresh time older than now minus
// refresh period. // refresh period.
$time = $this->time() - $period; $time = FEEDS_REQUEST_TIME - $period;
$result = db_query_range('SELECT feed_nid, id AS importer_id, callback, last_scheduled_time FROM {feeds_schedule} WHERE id = "%s" AND callback = "%s" AND scheduled = 0 AND (last_scheduled_time < %d OR last_scheduled_time = 0) ORDER BY last_scheduled_time ASC', $importer->id, $callback, $time, 0, $num); $result = db_query_range('SELECT feed_nid, id AS importer_id, callback, last_scheduled_time FROM {feeds_schedule} WHERE id = "%s" AND callback = "%s" AND scheduled = 0 AND (last_scheduled_time < %d OR last_scheduled_time = 0) ORDER BY last_scheduled_time ASC', $importer->id, $callback, $time, 0, $num);
while ($feed_info = db_fetch_array($result)) { while ($feed_info = db_fetch_array($result)) {
...@@ -230,37 +227,11 @@ class FeedsScheduler implements FeedsSchedulerInterface { ...@@ -230,37 +227,11 @@ class FeedsScheduler implements FeedsSchedulerInterface {
} }
} }
/**
* Set the internal time of FeedsScheduler.
* Use for debugging.
*
* @param $time
* UNIX time that the scheduler should use for comparing the schedule. Set
* this time to test the behavior of the scheduler in the future or past.
* If set to 0, FeedsScheduler will use the current time.
*/
public function debugSetTime($time) {
$this->debugTime = $time;
}
/**
* Returns the internal time that the scheduler is operating on.
*
* Usually returns FEEDS_REQUEST_TIME, unless a debug time has been set
* with debugSetTime();
*
* @return
* An integer that is a UNIX time.
*/
public function time() {
return empty($this->debugTime) ? FEEDS_REQUEST_TIME : $this->debugTime;
}
/** /**
* Helper function to flag a feed scheduled. * Helper function to flag a feed scheduled.
* *
* This function sets the feed's scheduled bit to 1 and updates * This function sets the feed's scheduled bit to 1 and updates
* last_scheduled_time to $this->time(). * last_scheduled_time to FEEDS_REQUEST_TIME.
* *
* @param $id * @param $id
* Id of the importer configuration. * Id of the importer configuration.
...@@ -274,7 +245,7 @@ class FeedsScheduler implements FeedsSchedulerInterface { ...@@ -274,7 +245,7 @@ class FeedsScheduler implements FeedsSchedulerInterface {
'id' => $id, 'id' => $id,
'callback' => $callback, 'callback' => $callback,
'feed_nid' => $feed_nid, 'feed_nid' => $feed_nid,
'last_scheduled_time' => $this->time(), 'last_scheduled_time' => FEEDS_REQUEST_TIME,
'scheduled' => 1, 'scheduled' => 1,
); );
drupal_write_record('feeds_schedule', $save, array('id', 'callback', 'feed_nid')); drupal_write_record('feeds_schedule', $save, array('id', 'callback', 'feed_nid'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment