A similar issue exists here: http://drupal.org/node/954872, but I wanted to create one under the 7.x version as well.
I currently have a node importer created with the following settings:
Update existing nodes: 'Replace existing nodes'
Expire nodes: 'after 1 hour'
I have my mapping settings such that each time I replace the existing nodes, I set the 'Published date' field on my nodes to the current time stamp. I have gone in and verified, when I look at one of the nodes, that the 'Authored by' field under the 'Authoring information' section for that node, has indeed been replaced properly.
However, time passes and the nodes never expire/never get deleted.
So I have two questions:
1) Is that the field that the node expiration setting is based on? The 'Published date' in the mapping for Node processor form?
2) What is actually triggering the expiration of nodes? I don't have much experience with the Job Scheduler module, but can see it's required for this module? Is running cron helping with triggering any actions or is it a totally separate set of events
Any clarification would be much appreciated, and if I can provide any additional info, I'd be happy to.
Thanks,
Boriana
Comments
Comment #1
ditcheva commented... and actually, I can see that the job scheduler is running when I look at the recent logs. However, it always comes back with "Finished processing scheduled jobs (0 sec s, 0 total, 0 failed)."
Comment #2
ditcheva commentedIt looks like the system does seem to be working... it just may not be working as I initially expected, which is mostly just because there's a lack of documentation on how the node expiration works, and so I wasn't understanding it properly.
It looks like hook_cron() -- which schedules the expiration job -- only reschedules it based on a 60 minute time period. So if you have a bunch of nodes that are about to expire in, let's say 5 minutes, but your job scheduler just ran, it's not going to run again until 60 minutes from now, doesn't matter that your nodes are expiring now, and doesn't matter how many times you run cron.
So that means your nodes may, in the worst case scenario, get expired roughly an hour after they're due.
I got all my tests done by simply modifying (on localhost under controlled circumstances!) the db entry for the job_schedule. If you look at that table, there are columns for period (set to 3600= 60 minutes) and the next time it is due to run (last+period). If you just set the column 'next' to the current timestamp (or some time in the past), you can get the job scheduler running more frequently than once an hour to at least get your testing, etc done.
Anyway -- just wanted to explain why I wasn't getting the behavior I was expecting and how this all works. Hopefully this small contribution to the documentation will help others.
I'm going to change this ticket to resolved, since I believe everything is working as expected!
Comment #3
OldAccount commentedI've tried your suggestions and still can't get the expiration to work, documentation is sparse to non-existent. I have my nodes set to expire after 1 hour, verified my Published Date mapping is working/correct, yet nothing happens, Job Scheduler says
"Finished processing scheduled jobs (0 sec s, 0 total, 0 failed)."even though I see afeeds_importer_expireentry in thejob_scheduletable of the database. Any tips you can think of, something I'm missing?Comment #4
jvdurme commentedIt's indeed not working. All nodes stay alive. Suggestions? Using alpha5 for D7.
Comment #5
funkeyrandy commentedis this working yet?
Comment #6
ajayg commentedNo it is not. Any suggestion which function (and in which file) the deletion triggers ? So we can start debugging. It seems (from my experience) the deletion works for some cases but not all and over a period of time the nodes gets accumulated and never getting deleted.
Comment #7
brad.bulger commentedSame for me. Somehow, the expiration job gets removed from the job_schedule table, and once that happens, it never gets re-inserted, and no expirations will be done from then on. Certainly, long-past-due nodes are never deleted.
Comment #8
byronveale commentedThere was a duplicate issue created that I closed (#1791954), here are the notes from there:
Comment #9
byronveale commentedPerhaps this is related to the issue (#930652) of expiry batching being broken? If anyone is still having trouble with this, please go try the patch available at that issue.
You may need to become acquainted with patches before trying to apply the patch.
Comment #10
bluegeek9 commentedDrupal 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!