Closed (fixed)
Project:
Feeds
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Aug 2010 at 16:04 UTC
Updated:
17 Sep 2010 at 21:10 UTC
In FeedsNodeProcessor.inc, the beginning of the process loop looks like this:
while ($item = $batch->shiftItem()) {
// Create/update if item does not exist or update existing is enabled.
if (!($nid = $this->existingItemId($item, $source)) || ($this->config['update_existing'] != FEEDS_SKIP_EXISTING)) {
$node = $this->buildNode($nid, $source->feed_nid);
// Only proceed if item has actually changed.
$hash = $this->hash($item);
if (!empty($nid) && $hash == $this->getHash($nid)) {
continue;
}
$node->feeds_node_item->hash = $hash;
As far as I can tell there is no reason buildNode() can not go under the hash-check, avoiding a call to buildNode/node_load everytime Feeds comes across already existing data. Patch attached, all tests passing (including my application-specific tests which depend on FeedsNodeProcessor->process)
| Comment | File | Size | Author |
|---|---|---|---|
| feeds-hash-before-build.patch | 1.02 KB | andrewlevine |
Comments
Comment #1
alex_b commentedgood call. RTBC.
Comment #2
andrewlevine commentedYep, should be ready to commit. We have been using this patch in development of our application for a while now.
Comment #3
alex_b commentedCommitted - thank you.
http://drupal.org/cvs?commit=416034