Problem
For importing and clearing sources through the web interface we use Drupal's batch API. This has the advantage that we can use multiple page loads to import a source or delete all items imported by it. The downside is that the browser must not be closed during this task, otherwise the task won't finished and left in a limbo.
While using batch API for processing these tasks is good for medium size imports, it is impractical for large and huge size imports where the total task time is simply too long for the browser to be expected present for the entire duration.
Solution
"Process in background" to the rescue: instead of using batch API to batch tasks through the browser, we can use Job Scheduler to process them in the background - just like we do on cron. When an 'import' or a 'clear' form is submitted, we can schedule an import or a clear job that is to be executed once.
Ideally, we could process all tasks in the background. Using batch API does have the advantage of being faster though. Hence I propose to make "Process in background" a Feeds Importer level option.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 927892-7_process_in_background.patch | 21.76 KB | alex_b |
| #6 | 927892-6_process_in_background.patch | 20.28 KB | alex_b |
| #5 | 927892-5_process_in_background.patch | 18.8 KB | alex_b |
| #3 | 927892-4_process_in_background.patch | 21.76 KB | alex_b |
| #2 | 927892-3_process_in_background.patch | 20.83 KB | alex_b |
Comments
Comment #1
alex_b commentedThis feature will also require the following adjustments:
- Hide import+clear button unless source state is empty.
- Add progress report on import and clear pages.
Comment #2
alex_b commentedThis is passing all tests now - all existing functionality is working. Missing: tests for process in background.
Comment #3
alex_b commentedFully functional. Enable 'process on import' on importer, upload a file, run cron. More fun with large files or directories of files.
Comment #4
alex_b commentedNeeds UI work.
Comment #5
alex_b commentedRerolled after #929058: Report status of source on import and delete forms was committed.
Reviewing now after #929058 provides substantial UI improvements.
Comment #6
alex_b commented- Cleaned up some minor bugs.
- Need to grey out all delete and import buttons when import/delete actions are going on.
Comment #7
alex_b commented- import/delete buttons disabled out when import/delete job is active.
Comment #8
alex_b commentedThis is committed now.
http://drupal.org/cvs?commit=431096
Comment #9
alex_b commented[deleted]