Question imports can take a long while. This can confuse the user or even lead to execution timeouts.
Let's use the Batch API to get around timeouts and update the user on how the import is progressing.
Question imports can take a long while. This can confuse the user or even lead to execution timeouts.
Let's use the Batch API to get around timeouts and update the user on how the import is progressing.
Comments
Comment #1
turadg commentedThis is harder than I thought, since the process is delegated to each engine+format for the actual operations.
If anyone wants to try this, a good start is by mimicking image_import_form_submit() in image_import.pages.inc
Until this is implemented, big imports may require that the max execution time is increased. We can also try working around it during imports by using ini_set(), when available:
ini_set('max_execution_time', '0'); // 0 = no limit.
That is only for the duration of the request.
Comment #2
sivaji_ganesh_jojodae commentedI don't think it is required for now. I can import around one thousand questions in less than 3 seconds. I am tempted to mark this as won't fix (at least postponed).
FYI : drupal database backup modules are using this function
ini_set('max_execution_time', '0');// 0 = no limit.Comment #3
mbutcher commentedThis is probably unnecessary for the time being, and implementing it would slow down the alpha release. Unless we have a real world use case, I'd suggest postponing this until it is requested.
Comment #4
turadg commented3 seconds, woah. My imports can take several minutes. I'm importing from WebCT format.
So I present my case as real world, but I expect it's not common. I agree this can wait for 4.1 or later.
Comment #5
falcon commentedComment #6
falcon commented