Add LBFactory::closeAll() method
authorBrion Vibber <brion@pobox.com>
Tue, 24 May 2016 15:32:12 +0000 (08:32 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 25 May 2016 07:43:23 +0000 (07:43 +0000)
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

index b78793f..5b048b5 100644 (file)
@@ -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', [] );
+       }
+
 }
 
 /**