swarrot / SwarrotBundle

A symfony bundle for swarrot integration
MIT License
89 stars 59 forks source link

Make Swarrot commands lazy #194

Closed wuchen90 closed 4 years ago

wuchen90 commented 4 years ago

Hello.

I have issues about commands created by SwarrotBundle that are booted even if I don't call them. Dependencies of these commands are then loaded like the processors and their dependencies.

I don't know if this is done in purpose but I think it is better if we make them lazy.

However This problem can be solved by adding to all commands the tag { name: console.command, command: swarrot.command.generated.foo_consumer } in Swarrot\SwarrotBundle\DependencyInjection\SwarrotExtension and removing commands registrations in Swarrot\SwarrotBundle\SwarrotBundle because Sf > 3 registrate them well with the tags.

I haven't dig further so can you tell me if it can work.

Thank you!

odolbeau commented 4 years ago

Hi @wuchen90 & thanks for this issue. I made the change in #195, could you please have a try?

wuchen90 commented 4 years ago

Hello @odolbeau I tested it and reviewed it: https://github.com/swarrot/SwarrotBundle/pull/195#pullrequestreview-370156459 Thank you for your time!