http://www.mediawiki.org/wiki/Special:Code/MediaWiki/66309

Revision: 66309
Author:   aaron
Date:     2010-05-12 21:49:03 +0000 (Wed, 12 May 2010)

Log Message:
-----------
* Reduced purgeExpiredConfigurations() transaction time
* Improved handling of expired items
* Removed fpc_select from query where not used

Modified Paths:
--------------
    trunk/extensions/FlaggedRevs/specialpages/ConfiguredPages_body.php
    trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php

Modified: trunk/extensions/FlaggedRevs/specialpages/ConfiguredPages_body.php
===================================================================
--- trunk/extensions/FlaggedRevs/specialpages/ConfiguredPages_body.php  
2010-05-12 21:45:38 UTC (rev 66308)
+++ trunk/extensions/FlaggedRevs/specialpages/ConfiguredPages_body.php  
2010-05-12 21:49:03 UTC (rev 66309)
@@ -59,8 +59,6 @@
 
        protected function showPageList() {
                global $wgOut;
-               # Take this opportunity to purge out expired configurations
-               FlaggedRevs::purgeExpiredConfigurations();
                $pager = new ConfiguredPagesPager( $this, array(),
                        $this->namespace, $this->override, $this->precedence, 
$this->autoreview );
                if ( $pager->getNumRows() ) {
@@ -70,6 +68,8 @@
                } else {
                        $wgOut->addHTML( wfMsgExt( 'configuredpages-none', 
array( 'parse' ) ) );
                }
+               # Take this opportunity to purge out expired configurations
+               FlaggedRevs::purgeExpiredConfigurations();
        }
 
        public function formatRow( $row ) {
@@ -178,13 +178,17 @@
                if ( $this->precedence !== null ) {
                        $conds['fpc_select'] = $this->precedence;
                }
-               if( $this->autoreview !== null ) {
+               if ( $this->autoreview !== null ) {
                        $conds['fpc_level'] = $this->autoreview;
                }
                $conds['page_namespace'] = $this->namespace;
+               # Be sure not to include expired items
+               $encCutoff = $this->mDb->addQuotes( $this->mDb->timestamp() );
+               $conds[] = "fpc_expiry > {$encCutoff}";
                return array(
                        'tables' => array( 'flaggedpage_config', 'page' ),
-                       'fields' => 
'page_namespace,page_title,fpc_override,fpc_expiry,fpc_page_id,fpc_select,fpc_level',
+                       'fields' => array( 'page_namespace', 'page_title', 
'fpc_override',
+                               'fpc_expiry', 'fpc_page_id', 'fpc_select', 
'fpc_level' ),
                        'conds'  => $conds,
                        'options' => array()
                );

Modified: trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php
===================================================================
--- trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php      
2010-05-12 21:45:38 UTC (rev 66308)
+++ trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php      
2010-05-12 21:49:03 UTC (rev 66309)
@@ -51,8 +51,6 @@
 
        protected function showPageList() {
                global $wgOut;
-               # Take this opportunity to purge out expired configurations
-               FlaggedRevs::purgeExpiredConfigurations();
                $pager = new StablePagesPager( $this, array(), 
$this->namespace, $this->autoreview );
                if ( $pager->getNumRows() ) {
                        $wgOut->addHTML( $pager->getNavigationBar() );
@@ -61,6 +59,8 @@
                } else {
                        $wgOut->addHTML( wfMsgExt( 'configuredpages-none', 
array( 'parse' ) ) );
                }
+               # Take this opportunity to purge out expired configurations
+               FlaggedRevs::purgeExpiredConfigurations();
        }
 
        public function formatRow( $row ) {
@@ -134,9 +134,13 @@
                        $conds['fpc_level'] = $this->autoreview;
                }
                $conds['page_namespace'] = $this->namespace;
+               # Be sure not to include expired items
+               $encCutoff = $this->mDb->addQuotes( $this->mDb->timestamp() );
+               $conds[] = "fpc_expiry > {$encCutoff}";
                return array(
                        'tables' => array( 'flaggedpage_config', 'page' ),
-                       'fields' => 
'page_namespace,page_title,fpc_override,fpc_expiry,fpc_page_id,fpc_select,fpc_level',
+                       'fields' => array( 'page_namespace', 'page_title', 
'fpc_override',
+                               'fpc_expiry', 'fpc_page_id', 'fpc_level' ),
                        'conds'  => $conds,
                        'options' => array()
                );



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to