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
10
10
{
11
11
public function process (ContainerBuilder $ container )
12
12
{
13
+ $ services = $ container ->findTaggedServiceIds ('old_sound_rabbit_mq.base_amqp ' );
14
+ $ container ->setParameter ('old_sound_rabbit_mq.base_amqp ' , array_keys ($ services ));
13
15
if (!$ container ->hasDefinition ('old_sound_rabbit_mq.parts_holder ' )) {
14
16
return ;
15
17
}
Original file line number Diff line number Diff line change @@ -23,10 +23,14 @@ public function build(ContainerBuilder $container)
23
23
public function shutdown ()
24
24
{
25
25
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 ' );
28
30
foreach ($ connections as $ connection ) {
29
- $ connection ->close ();
31
+ if ($ this ->container ->initialized ($ connection )) {
32
+ $ this ->container ->get ($ connection )->close ();
33
+ }
30
34
}
31
35
}
32
36
}
You can’t perform that action at this time.
0 commit comments