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.

Comments

alex_b’s picture

Category: bug » feature

This feature will also require the following adjustments:

- Hide import+clear button unless source state is empty.
- Add progress report on import and clear pages.

alex_b’s picture

Status: Active » Needs work
StatusFileSize
new20.83 KB

This is passing all tests now - all existing functionality is working. Missing: tests for process in background.

alex_b’s picture

StatusFileSize
new21.76 KB

Fully functional. Enable 'process on import' on importer, upload a file, run cron. More fun with large files or directories of files.

alex_b’s picture

Needs UI work.

alex_b’s picture

Status: Needs work » Needs review
StatusFileSize
new18.8 KB

Rerolled after #929058: Report status of source on import and delete forms was committed.

Reviewing now after #929058 provides substantial UI improvements.

alex_b’s picture

StatusFileSize
new20.28 KB

- Cleaned up some minor bugs.
- Need to grey out all delete and import buttons when import/delete actions are going on.

alex_b’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new21.76 KB

- import/delete buttons disabled out when import/delete job is active.

alex_b’s picture

Status: Reviewed & tested by the community » Fixed
alex_b’s picture

[deleted]

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.