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.
Hi,
I have 7 feeds that I want to import automatically with Cron.
When I import the feeds manually by clicking on "Process", they work fine.
But when I do it with cron, it seems that not all feeds are processed. I have allowed import overlap, and checked specified time interval from 00:00 to 24:00.
Maybe there is some other module to automate this? Ideally I would like to set the order in which the feeds are processed, and put a 5 minute delay between each feed processing.
Thanks for any ideas!
Comments
Comment #1
Taesto CreditAttribution: Taesto commentedI found a solution, will report here in case it helps someone:
With Elysia Cron API I added a cronapi function in feed_import_module to define one cron job for each feed.
Then it is easy in Elysia Cron to order the specific cron jobs for each feed. Now all feeds are run every fifteen minutes with no problem.
Comment #2
Sorin Sarca CreditAttribution: Sorin Sarca commentedYes, Elysia Cron is the best solution for cron import. In the next version I will add some drush commands to be able to import using OS cronjobs.
Comment #3
Taesto CreditAttribution: Taesto commentedI put this in feed_import_module by hand and it has worked well for the past days. There is probably a way to automatize the creation of the feed_import_myfeedx functions. I removed many of the checks of the original feed_import_cron function because with Elysia cron it is already possible to make sure that feeds are processed one after the other.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedFor me, cron doesn't trigger the importation of my feed. I used Elysia cron to set it up but even though Elysia reports that the cron job was run, the feed import was not processed. (i didn't use any custom php code)
Comment #5
Sorin Sarca CreditAttribution: Sorin Sarca commented@Taesto
I'll look for one.
@ervit
Please check settings for feed import
-make sure that "Cron import" is checked
-adjust settings for "When feeds can be imported", you may set it to "From time to time" and "Time between two imports at cron (seconds)" = 1 if you are using Elysia module
Also, don't forget to enable your feed to run at cron (click on Enable link in feed list if is disabled).
Comment #6
blake.thompson CreditAttribution: blake.thompson commentedJust on the off chance someone is looking for a more concise way to do several feeds
Edited to include longtom's correction
Comment #7
longtom CreditAttribution: longtom commentedDon't you need to 'return $items' in this code?
Comment #8
cdonner CreditAttribution: cdonner commentedWill this call the preprocessor function or do I have to call that myself as well, in addition to all the stuff? Why is there not a single entry point for running a feed that wraps all the checks and logic that needs to happen?
Never mind - this is 3 years old and does not apply. I am back at square 1. Amazing how such a simple task can become an insurmountable obstacle on this platform.
Comment #9
dureaghin CreditAttribution: dureaghin commented#6
I'm getting an Error "Class 'FeedImport' not found".