This module is very useful for configuring memory limit for pages. We come across a scenario, where we have increase memory limit for a specific drush command, since there is no such option present, so we have to raise memory limit of all drush commands in settings.php as mentioned here https://www.drupal.org/node/2295037.
It would be great to have options to raise memory limit for specific command using Memory limit policy, similar to specific page.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | support-for-drush-command-3160488-7.patch | 8.44 KB | rahul.shinde |
| #7 | interdiff_3160488_4_7.txt | 3.14 KB | rahul.shinde |
| #4 | support-for-drush-command-3160488-4.patch | 6.39 KB | rahul.shinde |
Comments
Comment #2
sharique commentedI checked the memory limit policy module, and it works on "KernelEvents::REQUEST", which doesn’t work in case of Drush. We need to look for any other approach to increase the memory limit for Drush commands.
https://git.drupalcode.org/project/memory_limit_policy/-/blob/8.x-1.x/sr...
Kernel request event only works the case of HTTP request (browser/curl). Drush commands very differently, currently there isn't any event that fired at the start of Drush command, introducing an event at beginning of Drush command can an option.
Comment #3
rahul.shindeComment #4
rahul.shindeAdding a new module supporting drush contraints.
Resources that I refered,
Comment #5
sharique commentedThanks a lot Rahul for posting a patch. Following are my review comments and suggestions.
It only take mymodule:doSomething but not do-something.
I'm using Drush version 10.3.1,
Comment #6
rahul.shindeComment #7
rahul.shindeUploaded the new patch adding README file.
@Sharique Please review.
Comment #8
sharique commentedAliases also working fine now. Thanks Rahul for patch.
Comment #10
vbouchetThanks for the patch and the review.
I adapted the code following https://www.drupal.org/project/memory_limit_policy/issues/3185785 but it is a really minor change.
I merged the code in 8.x-1.x branch.
Thanks again for the new feature.