Right now Feeds starts a batch job no matter whether the batch size per page load limit is reached or not. This could be easily modified so that we only batch if a job doesn't finish on the same page load.

Patch coming.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alex_b’s picture

Status: Active » Needs review
FileSize
2.44 KB

Trivial patch - how does this behave on the ground? Users that batch heavy feeds may appreciate the batch starting right away and not only after a first page load. On the other hand, I really don't like much the batch bar popping up for very light and quick imports like RSS feeds + data module.

I'm still on the fence on this one.

alex_b’s picture

Reroll after recent commit.

rjbrown99’s picture

I'm using this now, no problems here.

alex_b’s picture

Status: Needs review » Postponed

I am going to postpone this for now. Using the batch API no matter whether either case seems to be work fine.

kenorb’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

How about the option on import/% under 'Debug Options' to optionally parse without batch, as sometimes there is some needs for some debugging?

kenorb’s picture

Version: 7.x-1.x-dev » 7.x-2.0-beta1
Issue summary: View changes

Tried to implement it in 2.x, but there are too many references to these options, so I won't have time to do that. Here is my initial attempt. Probably this can be done in different way.

diff --git a/feeds/feeds_news/feeds_news.feeds_importer_default.inc b/feeds/feeds_news/feeds_news.feeds_importer_default.inc
index 3fa5ee7..0c71f09 100644
--- a/feeds/feeds_news/feeds_news.feeds_importer_default.inc
+++ b/feeds/feeds_news/feeds_news.feeds_importer_default.inc
@@ -72,6 +72,7 @@ function feeds_news_feeds_importer_default() {
     'expire_period' => 3600,
     'import_on_create' => 1,
     'process_in_background' => FALSE,
+    'process_now' => FALSE,
   );
   $export['feed'] = $feeds_importer;
 
diff --git a/feeds/includes/FeedsImporter.inc b/feeds/includes/FeedsImporter.inc
index 5286b1d..61f7a63 100644
--- a/feeds/includes/FeedsImporter.inc
+++ b/feeds/includes/FeedsImporter.inc
@@ -198,6 +198,7 @@ public function configDefaults() {
       'expire_period' => 3600, // Expire every hour by default, this is a hidden setting.
       'import_on_create' => TRUE, // Import on submission.
       'process_in_background' => FALSE,
+      'process_now' => FALSE,
     );
   }
 
diff --git a/feeds/includes/FeedsSource.inc b/feeds/includes/FeedsSource.inc
index 1fc5209..74b69cc 100644
--- a/feeds/includes/FeedsSource.inc
+++ b/feeds/includes/FeedsSource.inc
@@ -251,6 +251,10 @@ public function preview() {
    */
   public function startImport() {
     $config = $this->importer->getConfig();
+    if ($config['process_now']) {
+      $queue = DrupalQueue::get('feeds_source_import');
+      $queue->createItem($job);
+    }
     if ($config['process_in_background']) {
       $this->startBackgroundJob('import');