Creating a large amount of user accounts, in my case 25,000 in a single CSV import fails because the user_save() call in turn calls the usernode_user() and this is generating the usernode using drupal_execute().

The FormsAPI has icky static variables all over and during a large import is causing memory to be consumed quickly, resulting in my PHP script from exhausting available memory (100M!)

Is drupal_execute() really necessary over good old node_save() ?

Comments

fago’s picture

Status: Active » Fixed

hm, indeed, I'm not so a fan anymore of drupal_execute() too - but changing this would require a lot of new tests to ensure the stability of the module in any case, a lot of work - so it's not gonna happen.. ;)

budda’s picture

Status: Fixed » Closed (won't fix)

I got around the problem by making a separate menu callback in drupal which could process a chunk of CSV data then finish.
I then called the menu callback from the main import routine in a loop using drupal_http_request()

Worked perfectly.