jenkins-bot has submitted this change and it was merged. Change subject: Use setting for property info table cache key ......................................................................
Use setting for property info table cache key This allows the cache key to change with each deployment and whatnot. Change-Id: I53908d3626d245236f9c82cf4c81993f02cdef5e --- M client/includes/store/sql/DirectSqlStore.php M repo/includes/store/sql/SqlStore.php 2 files changed, 7 insertions(+), 10 deletions(-) Approvals: Daniel Kinzler: Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/store/sql/DirectSqlStore.php b/client/includes/store/sql/DirectSqlStore.php index 71719d1..2231584 100644 --- a/client/includes/store/sql/DirectSqlStore.php +++ b/client/includes/store/sql/DirectSqlStore.php @@ -327,11 +327,9 @@ protected function newPropertyInfoTable() { if ( Settings::get( 'usePropertyInfoTable' ) ) { $table = new PropertyInfoTable( true, $this->repoWiki ); - - //TODO: get cache type etc from config - //TODO: better version ID from config! - $key = $this->repoWiki . '/Wikibase/CachingPropertyInfoStore/' . WBL_VERSION; - return new CachingPropertyInfoStore( $table, wfGetMainCache(), 3600, $key ); + $key = $this->cachePrefix . ':CachingPropertyInfoStore'; + return new CachingPropertyInfoStore( $table, ObjectCache::getInstance( $this->cacheType ), + $this->cacheDuration, $key ); } else { // dummy info store return new DummyPropertyInfoStore(); diff --git a/repo/includes/store/sql/SqlStore.php b/repo/includes/store/sql/SqlStore.php index b86035e..08238f2 100644 --- a/repo/includes/store/sql/SqlStore.php +++ b/repo/includes/store/sql/SqlStore.php @@ -3,6 +3,7 @@ namespace Wikibase; use DBQueryError; +use ObjectCache; use Wikibase\DataModel\Entity\BasicEntityIdParser; use Wikibase\Repo\WikibaseRepo; @@ -382,11 +383,9 @@ protected function newPropertyInfoTable() { if ( Settings::get( 'usePropertyInfoTable' ) ) { $table = new PropertyInfoTable( false ); - - //TODO: get cache type etc from config - //TODO: better version ID from config! - $key = wfWikiID() . '/Wikibase/CachingPropertyInfoStore/' . WBL_VERSION; - return new CachingPropertyInfoStore( $table, wfGetMainCache(), 3600, $key ); + $key = $this->cachePrefix . ':CachingPropertyInfoStore'; + return new CachingPropertyInfoStore( $table, ObjectCache::getInstance( $this->cacheType ), + $this->cacheDuration, $key ); } else { // dummy info store return new DummyPropertyInfoStore(); -- To view, visit https://gerrit.wikimedia.org/r/99647 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I53908d3626d245236f9c82cf4c81993f02cdef5e Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Daniel Kinzler <daniel.kinz...@wikimedia.de> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits