Drupal sets a fixed 240 seconds time limit for the entire cron run. For large user imports, this is usually not enough. I have changed the user_import_cron function to reset the time limit to allow for two seconds for every row that is allowed to be imported. I think it is useful for anyone importing a large number of users using cron. It applies to the latest git version.

CommentFileSizeAuthor
#2 bug-1248246.patch1.95 KBJorrit
#1 bug-1248246.patch5.84 KBJorrit

Comments

Jorrit’s picture

Status: Active » Needs review
StatusFileSize
new5.84 KB
Jorrit’s picture

StatusFileSize
new1.95 KB

Some other files got added to the patch. This one is better.

Parkes Design’s picture

Giving this a go. Thanks for contributing!

robert castelo’s picture

Status: Needs review » Closed (works as designed)

I'm not clear on what the point of this patch is.

If an import doesn't complete in one cron run it will carry on in subsequent cron runs, so it doesn't matter if it times out.

Time limit of PHP is set at the system level, I don't think we should be interfering with that in Drupal.