Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support --limit option in entity:delete command #6007

Closed
tibezh opened this issue May 17, 2024 · 3 comments
Closed

Support --limit option in entity:delete command #6007

tibezh opened this issue May 17, 2024 · 3 comments

Comments

@tibezh
Copy link
Contributor

tibezh commented May 17, 2024

Is your feature request related to a problem? Please describe.
I have similar that already described her #5784.

On the website with Drupal Commerce I have >5K commerce_order entities, I need to delete ALL of them, and got memory_limit error (with memory_limit=-1 in php.ini) for a command: drush entity:delete commerce_order

Describe the solution you'd like
I think we can have a little improvement for the entity:delete command and use a little trick to delete entities with bash loop.
I mean run command like:
i="0"; while [ $i -lt 100 ]; do $DRUSH entity:delete commerce_order --limit=500; i=$[$i+1]; done

Describe alternatives you've considered
I've tried to execute drupal_static_reset() function after each drush batch iteration and it not helped, still have memory leaks.

Additional context
Will provide a PR a little bit later.

@tibezh
Copy link
Contributor Author

tibezh commented May 17, 2024

PR is added, could somebody check, please?

@tibezh
Copy link
Contributor Author

tibezh commented May 31, 2024

The #6008 PR is merged, so we can close the issue, thank you!

@tibezh tibezh closed this as completed May 31, 2024
@gitressa
Copy link
Contributor

Thanks for creating this new feature @tibezh, it's so great to see the Drupal and Drush eco-system constantly improving.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants