Closed (fixed)
Project:
Feeds
Version:
8.x-3.0-alpha4
Component:
Feeds Import (feature)
Priority:
Major
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
26 Jul 2019 at 09:55 UTC
Updated:
15 Aug 2019 at 10:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
megachrizYes, the import period depends on cron.
I see that this isn't mentioned on the form, while the D7 of Feeds did mention it. Attached a patch to fix that.
Comment #3
sethu_sk commentedHi MegaChriz,
I have a question:
How do I run the feed CRON alone in every 'X' minutes without running the site CRON?
Please clarify it.
Comment #4
megachrizYou could write a shell script that runs every x minutes and in there run items from the queue "feeds_feed_refresh".
Example:
Comment #6
megachrizTests are passing for the patch, so committed #2.
Comment #7
megachrizOh wait, in a shell script you could also use the Drush command 'queue-run'. Is a lot simpler.
https://drushcommands.com/drush-9x/queue/queue:run/
Comment #8
sethu_sk commentedHi MegaChriz,
I am new to drupal 8, where do I need to write the code, do i need to create a module for this?
Kindly clarify it.
Comment #9
megachrizDo the instructions on the following page help?
https://www.webfoobar.com/index.php/node/25
From the example there, instead of
drush @site1 cron, your command would bedrush @site1 queue-run feeds_feed_refresh.The code presented there would go into a .crontab file.
Either way, you need to be able to run cron jobs to run imports regularly. With the method described above you can avoid running cron for all modules.
Comment #10
megachrizAfter posting I just realized you'll get more control about which module's cron to run with the Ultimate Cron module.
On crontab you would configure to run regular cron every minute and with Ultimate Cron you can configure in the Drupal user interface per module and per queue how often they may run.
I haven't tried the module for D8 yet, but the D7 version worked great.
Comment #11
sethu_sk commentedAm getting below error message.
"Drupal\Component\Plugin\Exception\PluginNotFoundException: The "feeds_feed_refresh" plugin does not exist" issue while running the custom drush command for drupal 8.
Comment #12
megachriz@John_sm
Ah, I forgot the queue "feeds_feed_refresh" is a derivative, which means in this case that a queue plugin is generated for every feed type. So the actual queue would be called something like "feeds_feed_refresh:my_feed_type" where "my_feed_type" is the machine name of your feed type.
Secondly, the queues can be empty, because they require
feeds_cron()to be called in order to schedule imports. So it looks like your command would also need to call that function:Comment #13
sethu_sk commented@MegaChriz, i have added two drush command in cronjob to import the external data into our site. I have a question, in your above feeds_feed_refresh code, what is the value for $queue_name.
Will the above code work when we callback the method without any drush command?
Comment #14
megachriz@John_sm
The queue name is
feeds_feed_refresh:plus the feed type ID.