Hi,

I need to delete a lot of orders on my site each time the process is launched, and I'm afraid of the memory load.
For example on the live site I'll need to delete more than 500k orders, and after that I'll still have to clean a lot of orders every two weeks or so.
I could not run the process on live data yet, but since an entity load is done fore each order and hooks are called, it could be problematic.

I think adding another parameter to specify the number of orders to process at each cron run would be useful and should take care of the problem.

What do you think?

Comments

jgalletta’s picture

Category: support » feature
Status: Active » Needs review
StatusFileSize
new6.58 KB

Here's the solution I developed, tell me what you think about it.

I added a "limit" parameter to be able to specify a maximum number of orders to be processed at a time.
I also modified the drush command to add a corresponding option (not argument, as I think this is an advanced feature and in most cases we want the drush command to run without it and to not take care of default rule value, but it's just my point of view).

amateescu’s picture

Status: Needs review » Fixed

Sorry for the long delay here :( I made a few modifications and some unrelated clean-ups and committed to 7.x-1.x.

http://drupalcode.org/sandbox/amateescu/1454320.git/commit/3e824b9

Status: Fixed » Closed (fixed)

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