Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have several import nodes from the same Feed Importer configuration. I want to override the import_period per node, because sometimes I want to disable fetching for a node or set a different period when the feed should be fetched.
Proposed solution: add a import_period override to FeedsHTTPFetcher.
Comment | File | Size | Author |
---|---|---|---|
#7 | feeds-period-1984982-7.patch | 2.1 KB | klausi |
Comments
Comment #1
klausiPatch attached.
Comment #3
klausiAdded an isset() for the new setting to avoid PHP notices for old configurations.
Comment #4
klausiNow that we use queue scheduling directly in scheduleImport() of FeedsSource we need to be careful to only invoke schedule if the batch is complete.
Comment #5
twistor CreditAttribution: twistor commentedHmm... I'm not sure about this. I've been avoiding adding more options at this point.
If we can only re-schedule when the batch is complete, then form should be disabled if the progress is running. However, it should always be safe to call $source->schedule(), so does this means we introduced a bug in scheduleImport()?
Still not sure, but at a minimum, this would have to be optional. I don't want everyone to get a new form option in everybody's face. This could be done in a contrib module.
Comment #6
klausiIt is not safe to call $source->schedule() now, because we add items to the queue if a batch is in progress. What happened to me in this case is that every import step triggers a source safe which had triggered a schedule() with this patch. So I got 32.000 queue items for one import node with this patch, meaning that the import would run amok and execute all the time with cron.
So maybe we should consider the earlier patch version in #1231332: periodic import imports only one file per cron, which only adds to the queue in the queue worker.
Comment #7
klausiJust updating the patch here because FEEDS_BATCH_COMPLETE is now a float.