? 744660-45_full_batching.patch
? 744660-67_full_batching.patch
Index: includes/FeedsBatch.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feeds/includes/FeedsBatch.inc,v
retrieving revision 1.14
diff -r1.14 FeedsBatch.inc
169a170,220
>    * Determine whether batch needs fetching.
>    *
>    * A batch needs fetching when the fetching stage is not complete and the
>    * parsing stage and the processing stage are complete.
>    *
>    * @return
>    *   TRUE if batch needs fetching, FALSE if it doesn't.
>    */
>   public function needsFetching() {
>     if ($this->progress[FEEDS_FETCHING] != FEEDS_BATCH_COMPLETE &&
>         $this->progress[FEEDS_PARSING] == FEEDS_BATCH_COMPLETE &&
>         $this->progress[FEEDS_PROCESSING] == FEEDS_BATCH_COMPLETE) {
>       return TRUE;
>     }
>     return FALSE;
>   }
> 
>   /**
>    * Determine whether batch needs parsing.
>    *
>    * A batch needs parsing if the parsing stage is not complete and the
>    * processing stage is complete.
>    *
>    * @return
>    *   TRUE if batch needs parsing, FALSE if it doesn't.
>    */
>   public function needsParsing() {
>     if ($this->progress[FEEDS_PARSING] != FEEDS_BATCH_COMPLETE &&
>         $this->progress[FEEDS_PROCESSING] == FEEDS_BATCH_COMPLETE) {
>       return TRUE;
>     }
>     return FALSE;
>   }
> 
>   /**
>    * Determine whether batch needs processing.
>    *
>    * A batch needs processing when the processing stage is not complete, no
>    * matter what status the fetching or parsing state are in.
>    *
>    * @return
>    *   TRUE if batch needs processing, FALSE if it doesn't.
>    */
>   public function needsProcessing() {
>     if ($this->progress[FEEDS_PROCESSING] != FEEDS_BATCH_COMPLETE) {
>       return TRUE;
>     }
>     return FALSE;
>   }
> 
>   /**
Index: includes/FeedsSource.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feeds/includes/FeedsSource.inc,v
retrieving revision 1.16
diff -r1.16 FeedsSource.inc
140c140,142
<       if (!$this->batch || !($this->batch instanceof FeedsImportBatch)) {
---
>       if (!$this->batch ||
>           !($this->batch instanceof FeedsImportBatch) ||
>           $this->batch->needsFetching()) {
141a144,147
>         $this->batch->setProgress(FEEDS_PARSING, FEEDS_BATCH_ACTIVE);
>       }
>       if ($this->batch->needsParsing()) {
>         $this->batch->setProgress(FEEDS_PARSING, FEEDS_BATCH_COMPLETE);
142a149,153
>         $this->batch->setProgress(FEEDS_PROCESSING, FEEDS_BATCH_ACTIVE);
>       }
>       if ($this->batch->needsProcessing()) {
>         $this->batch->setProgress(FEEDS_PROCESSING, FEEDS_BATCH_COMPLETE);
>         $this->importer->processor->process($this->batch, $this);
144d154
<       $this->importer->processor->process($this->batch, $this);
Index: plugins/FeedsCSVParser.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feeds/plugins/FeedsCSVParser.inc,v
retrieving revision 1.13
diff -r1.13 FeedsCSVParser.inc
3a4,6
> // Number of lines to parse in one page load.
> define('FEEDS_PARSER_CSV_BATCH_SIZE', 5);
> 
34,36c37,39
<     // Set line limit to 0 and start byte to last position and parse rest.
<     $parser->setLineLimit(0);
<     $parser->setStartByte($parser->lastLinePos());
---
>     // Set line limit and start byte to last position and parse rest.
>     $parser->setLineLimit(FEEDS_PARSER_CSV_BATCH_SIZE);
>     $parser->setStartByte($batch->parser_pos ? $batch->parser_pos : $parser->lastLinePos());
38a42,51
>     // Remember last parser position if we did not get to the end of the file.
>     if ($pos = $parser->lastLinePos()) {
>       $batch->parser_pos = $pos;
>       $batch->setTotal(FEEDS_PARSING, filesize(realpath($batch->getFilePath())));
>       $batch->setProgress(FEEDS_PARSING, $pos);
>     }
>     else {
>       $batch->setProgress(FEEDS_PARSING, FEEDS_BATCH_COMPLETE);
>     }
> 
