DAT-3192 Invalidate memcache on allinfoboxes query update

This commit is contained in:
Sebastian Marzjan 2015-09-08 10:42:49 -07:00
parent f025c91d2d
commit ce6f4e7646
3 changed files with 8 additions and 0 deletions

View file

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

View file

@ -49,4 +49,9 @@ class PortableInfoboxHooks {
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();
}
wfRunHooks( 'AllInfoboxesQueryRecached' );
return $inserted;
}