* (bug 28485) Block::purgeExpired Database returned error "1205: Lock wait timeout...
authorSam Reed <reedy@users.mediawiki.org>
Mon, 11 Apr 2011 00:29:42 +0000 (00:29 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Mon, 11 Apr 2011 00:29:42 +0000 (00:29 +0000)
Commit changes per Tims suggestion on the ubg

RELEASE-NOTES
includes/Block.php

index 84997ba..4a7e9c7 100644 (file)
@@ -235,8 +235,10 @@ PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 28372) Fix bogus link to suppressed file versions in ForeignDBRepo
 * (bug 27473) Fix regression: bold, italic no longer interfere with linktrail for ca, kaa
 * (bug 28444) Fix regression: edit-on-doubleclick retains revision id again
+* (bug 28485) Block::purgeExpired Database returned error "1205: Lock wait timeout
+  exceeded;"
 
-=== API changes in 1.18 ===
+ === API changes in 1.18 ===
 * (bug 26339) Throw warning when truncating an overlarge API result
 * (bug 14869) Add API module for accessing QueryPage-based special pages
 * (bug 14020) API for Special:Unwatchedpages
index f1b3e7f..2ef8e5b 100644 (file)
@@ -889,8 +889,13 @@ class Block {
         * Purge expired blocks from the ipblocks table
         */
        public static function purgeExpired() {
-               $dbw = wfGetDB( DB_MASTER );
+               $lb = wfGetLBFactory()->newMainLB();
+               $dbw = $lb->getConnection( DB_MASTER );
+
                $dbw->delete( 'ipblocks', array( 'ipb_expiry < ' . $dbw->addQuotes( $dbw->timestamp() ) ), __METHOD__ );
+
+               $lb->commitMasterChanges();
+               $lb->closeAll();
        }
 
        /**