File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
DependencyInjection/Compiler Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ class RegisterPartsPass implements CompilerPassInterface
1010{
1111 public function process (ContainerBuilder $ container )
1212 {
13+ $ services = $ container ->findTaggedServiceIds ('old_sound_rabbit_mq.base_amqp ' );
14+ $ container ->setParameter ('old_sound_rabbit_mq.base_amqp ' , array_keys ($ services ));
1315 if (!$ container ->hasDefinition ('old_sound_rabbit_mq.parts_holder ' )) {
1416 return ;
1517 }
Original file line number Diff line number Diff line change @@ -23,10 +23,14 @@ public function build(ContainerBuilder $container)
2323 public function shutdown ()
2424 {
2525 parent ::shutdown ();
26- $ partHolder = $ this ->container ->get ('old_sound_rabbit_mq.parts_holder ' );
27- $ connections = $ partHolder ->getParts ("old_sound_rabbit_mq.base_amqp " );
26+ if (!$ this ->container ->hasParameter ('old_sound_rabbit_mq.base_amqp ' )) {
27+ return ;
28+ }
29+ $ connections = $ this ->container ->getParameter ('old_sound_rabbit_mq.base_amqp ' );
2830 foreach ($ connections as $ connection ) {
29- $ connection ->close ();
31+ if ($ this ->container ->initialized ($ connection )) {
32+ $ this ->container ->get ($ connection )->close ();
33+ }
3034 }
3135 }
3236}
You can’t perform that action at this time.
0 commit comments