From 9fbecbe2e527e4d1ec1de34d4286fc80f900bcd7 Mon Sep 17 00:00:00 2001 From: Alexandr Zolotukhin Date: Wed, 18 Apr 2018 16:54:04 +0300 Subject: [PATCH 1/2] Added bundle's shutdown function --- SncRedisBundle.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/SncRedisBundle.php b/SncRedisBundle.php index 66d0dddd..01da6525 100644 --- a/SncRedisBundle.php +++ b/SncRedisBundle.php @@ -32,4 +32,17 @@ public function build(ContainerBuilder $container) $container->addCompilerPass(new MonologPass()); $container->addCompilerPass(new SwiftMailerPass()); } + + /** + * {@inheritDoc} + */ + public function shutdown() + { + // Close session handler connection to avoid using up all available connection slots in tests + if ($this->container->has('snc_redis.session.handler')) { + if (!method_exists($this->container, 'initialized') || $this->container->initialized('snc_redis.session.handler')) { + $this->container->get('snc_redis.session.handler')->close(); + } + } + } } From f6e9a8afdf4a14a6c1cb4699d5544565ff1090a0 Mon Sep 17 00:00:00 2001 From: Alexandr Zolotukhin Date: Wed, 18 Apr 2018 16:55:00 +0300 Subject: [PATCH 2/2] Declared snc_redis.session.handler service as public (Sf 4.0 compat.) --- Resources/config/session.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/config/session.xml b/Resources/config/session.xml index b9a6cba1..f0cb2369 100644 --- a/Resources/config/session.xml +++ b/Resources/config/session.xml @@ -11,7 +11,7 @@ - + %session.storage.options% %snc_redis.session.prefix%