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

#653412 rbrandon: Do not create items older than expiry time.

parent 11d6882c
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
Feeds 6.x 1.0 xxxxxxxxxxxxxxxxxxxx Feeds 6.x 1.0 xxxxxxxxxxxxxxxxxxxx
---------------------------------- ----------------------------------
- #653412 rbrandon: Do not create items older than expiry time.
- #725392 nicholasThompson: FeedsBatch does not check feeds folder exists before - #725392 nicholasThompson: FeedsBatch does not check feeds folder exists before
uploading. uploading.
- #776972 lyricnz: Messages use plural when describing single item. - #776972 lyricnz: Messages use plural when describing single item.
......
...@@ -18,6 +18,7 @@ class FeedsDataProcessor extends FeedsProcessor { ...@@ -18,6 +18,7 @@ class FeedsDataProcessor extends FeedsProcessor {
// Count number of created and updated nodes. // Count number of created and updated nodes.
$inserted = $updated = 0; $inserted = $updated = 0;
$expiry_time = $this->expiryTime();
while ($item = $batch->shiftItem()) { while ($item = $batch->shiftItem()) {
if (!($id = $this->existingItemId($item, $source)) || $this->config['update_existing']) { if (!($id = $this->existingItemId($item, $source)) || $this->config['update_existing']) {
...@@ -27,6 +28,11 @@ class FeedsDataProcessor extends FeedsProcessor { ...@@ -27,6 +28,11 @@ class FeedsDataProcessor extends FeedsProcessor {
$data['timestamp'] = FEEDS_REQUEST_TIME; $data['timestamp'] = FEEDS_REQUEST_TIME;
$data = $this->map($item, $data); $data = $this->map($item, $data);
// Only save if this item is not expired.
if ($expiry_time != FEEDS_EXPIRE_NEVER && $data['timestamp'] < (FEEDS_REQUEST_TIME - $expiry_time)) {
continue;
}
// Save data. // Save data.
if ($id) { if ($id) {
$data['id'] = $id; $data['id'] = $id;
......
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