Dear all,

I've found some important issue to solve. The scenario is the next,
-Using Feeds to import data to nodes
-Set a expiration time to the nodes (in order to delete content that doesn't exsist in the feed anymore)

I've found that Feeds is first doing the process the imports and then the processing the expired nodes:

$source->schedule();
feeds_importer($importer_id)->schedule();

In this code the firs line is setting the Import Job "feeds_source_import", and the second one is setting the Expire Job "feeds_importer_expire".

Consecuently, first is importing the data and then deleting the nodes that already expired causing that the total list of imported nodes is incomplete until another Cron run is executed and therefore the expired nodes are again imported.

It could be even worst if you configure the expiration date to for example 1 hour and the cron job to run also each 1 hour, in that case you will always have X elements less than it should, being X the limit configured in the,

$conf['feeds_process_limit'] = 50;

I found more reasonable to first delete the expired nodes and then do the importation.

Many thanks

Comments

sickes’s picture

Issue summary: View changes

errors

sickes’s picture

Issue summary: View changes

errors +

franz’s picture

Category: feature » support
Priority: Critical » Normal

Why don't you use the "Update nodes" or "Replace nodes" instead?

franz’s picture

Expiration only makes sense to me if you're not going to re-import the same content again.

OldAccount’s picture

Makes sense, but how do you deal with a small percentage of nodes that need to be removed from the feed?

For example, I have a product feed that will be importing items daily. Day 1, 500 products might be available, day 2 maybe 10 of them might be sold out and need to be deleted. Even though most of them just need to be updated, isn't the only way to ensure no unavailable products are listed is to expire all nodes and re-import fresh daily?

franz’s picture

I see, but still, your use case seems to be more than what Feeds was designed for. I've worked on a project I had to unpublish a previously imported node if it's not present in the next import. You can achieve this by code hooking into after_import and checking timestamps of all feed items for the importer. Still, it sounds like a custom requirement.

However, if you figure out a simple patch for this that doesn't affect the module negatively, we can push it without trouble.

OldAccount’s picture

I was able to get a handle on my import requirements with the help of the Elysia Cron module, no custom hooks needed: http://drupal.org/node/1758842.

OldAccount’s picture

Issue summary: View changes

d

tky’s picture

Version: 7.x-2.0-alpha4 » 7.x-2.0-alpha8
Component: Feeds Import » Code
Issue summary: View changes

Hi, everyone,

I have tried to use feeds module in my site as a news syndication tool.
I set feeds to expire the feed items that older than 3 months, but keep seeing them after next cron ran.
It seems that this re-import expired node issue have'nt be solved.

bluegeek9’s picture

Status: Active » Closed (outdated)

Drupal 7 reached end of life and the D7 version of Feeds is no longer being developed. To keep the issue queue focused on supported versions, we’re closing older D7 issues.

If you still have questions about using Feeds on Drupal 7, feel free to ask. While we won’t fix D7 bugs anymore, we’re happy to offer guidance to help you move forward. You can do so by opening (or reopening) a D7 issue, or by reaching out in the #feeds channel on Drupal Slack.

If this issue is still relevant for Drupal 10+, please open a follow-up issue or merge request with proposed changes. Contributions are always welcome!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.