From 874918485692cd77639174d32e43e5ddbb1229f7 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 24 May 2016 08:32:12 -0700 Subject: [PATCH] Add LBFactory::closeAll() method Needed to allow long-running background tasks to close out database connections in a way that allows them to reopen later when needed again. Bug: T97641 Change-Id: I4974b691392d4225b15e7b771a28a2cefeb9d8e4 --- includes/db/loadbalancer/LBFactory.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/includes/db/loadbalancer/LBFactory.php b/includes/db/loadbalancer/LBFactory.php index b78793f8aa..5b048b53d8 100644 --- a/includes/db/loadbalancer/LBFactory.php +++ b/includes/db/loadbalancer/LBFactory.php @@ -452,6 +452,15 @@ abstract class LBFactory implements DestructibleService { } } ); } + + /** + * Close all open database connections on all open load balancers. + * @since 1.28 + */ + public function closeAll() { + $this->forEachLBCallMethod( 'closeAll', [] ); + } + } /** -- 2.20.1