Merge pull request #8383 from Wikia/DAT-3192

DAT-3192 Invalidate memcache on allinfoboxes query update
This commit is contained in:
Nikodem 2015-09-09 16:48:01 +02:00
commit a3b3cce449
3 changed files with 8 additions and 0 deletions

View file

@ -66,6 +66,7 @@ $wgHooks[ 'BeforePageDisplay' ][] = 'PortableInfoboxHooks::onBeforePageDisplay';
$wgHooks[ 'ParserAfterTidy' ][] = 'PortableInfoboxParserTagController::replaceInfoboxMarkers'; $wgHooks[ 'ParserAfterTidy' ][] = 'PortableInfoboxParserTagController::replaceInfoboxMarkers';
$wgHooks[ 'ImageServing::buildAndGetIndex' ][] = 'PortableInfoboxHooks::onImageServingCollectImages'; $wgHooks[ 'ImageServing::buildAndGetIndex' ][] = 'PortableInfoboxHooks::onImageServingCollectImages';
$wgHooks[ 'wgQueryPages' ][] = 'PortableInfoboxHooks::onWgQueryPages'; $wgHooks[ 'wgQueryPages' ][] = 'PortableInfoboxHooks::onWgQueryPages';
$wgHooks[ 'AllInfoboxesQueryRecached' ][] = 'PortableInfoboxHooks::onAllInfoboxesQueryRecached';
// special pages // special pages
$wgSpecialPages[ 'AllInfoboxes' ] = 'AllinfoboxesQueryPage'; $wgSpecialPages[ 'AllInfoboxes' ] = 'AllinfoboxesQueryPage';

View file

@ -49,4 +49,9 @@ class PortableInfoboxHooks {
return true; return true;
} }
static public function onAllInfoboxesQueryRecached() {
F::app()->wg->Memc->delete( wfMemcKey( ApiQueryAllinfoboxes::MCACHE_KEY ) );
return true;
}
} }

View file

@ -73,6 +73,8 @@ class AllinfoboxesQueryPage extends PageQueryPage {
$dbw->commit(); $dbw->commit();
} }
wfRunHooks( 'AllInfoboxesQueryRecached' );
return $inserted; return $inserted;
} }