Closed (fixed)
Project:
Feeds
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Jun 2010 at 20:53 UTC
Updated:
10 Aug 2010 at 19:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
alex_b commentedI'd suggest to blow the hash away when submitting the mapping form.
Comment #2
andrewlevine commentedWould you be comfortable having this as the default behavior? I think it could work...but it seems like a pretty significant (in terms of performance and unanticipated behavior) thing to do without the user's knowledge. Should it be a a setting under "Basic settings"? Should it be defaulted to on or off?
Comment #3
alex_b commentedYes.
Offering a button that would clear that hash cache manually would assume the user's knowledge about some of the internals of Feeds and can cause some unnecessary confusion. Given that blowing away the hash is comparatively cheap - it's fine to clear it wherever necessary. Just like a cache.
Comment #4
andrewlevine commentedwill work on a patch for this
Comment #5
andrewlevine commentedHere is my go at this issue. I think I actually did it in a more flexible way than what we talked about in IRC:
FeedsProcessor keeps track in a class variable whether the mappings have been changed or not. This way any extending processor can use this variable in its save() method. By default, only FeedsNodeProcessor uses this variable, and will clear the proper hashes in feeds_node_item in save().
Let me know what you think.
Comment #6
andrewlevine commentedI can also make a test for this once #837922: add removeMappings() to test suite and more extensive addMapping testing gets in
Comment #7
alex_b commentedI was just reviewing and my first thought was that I'd like to avoid the mapping_changed flag as it assumes knowledge around a state (mapping_changed) of the processor object in more than one class. States like these get very sticky fast.
Then I actually saw that we won't get away with an update on all feed items because if there is A LOT of them the update gets slow (I just measured .32 s on 5000 items which makes me queasy enough).
I think we should tackle this problem completely different and hash configuration together with items. See attached patch.
BTW, I'd also like to stay away from rescheduling items. Would love to learn more about your thinking behind that though.
Comment #8
andrewlevine commentedI really like this approach you are taking though updating all feed items on every single configuration change makes me nervous because we have no idea what this change will do to existing extensions of FeedsNodeProcessor. I will make a patch that only includes some of the configuration changes.
The only reason I rescheduled items is because that's what happens on "Delete" of feed items. I have no problems leaving that out .
Comment #9
andrewlevine commentedThe attached patch adds some complexity over patch #7 but it also means:
Comment #10
alex_b commentedI am fine to only hash mappings, but I would *really* like to keep this as simple as possible.
- Only serializes config['mappings']
- Caches serialized array for performance
- Overriding still simple
Running tests now, thinking of committing this soon.
Comment #11
alex_b commentedI've committed #10 now, thank you for your great input. If you'd like to suggest adjustments to this patch, let's deal with it on a separate issue.
http://drupal.org/cvs?commit=398516
Comment #12
andrewlevine commentedThanks for the review and the commit. I'm fine with #10