r103684 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103683‎ | r103684 | r103685 >
Date:16:23, 19 November 2011
Author:hashar
Status:reverted
Tags:
Comment:
add possibility to close a LCStore_CDB
also close an LCStore_CDB after checking for expiry
Modified paths:
  • /trunk/phase3/includes/LocalisationCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LocalisationCache.php
@@ -358,6 +358,7 @@
359359 $deps = $this->store->get( $code, 'deps' );
360360 $keys = $this->store->get( $code, 'list', 'messages' );
361361 $preload = $this->store->get( $code, 'preload' );
 362+ $this->store->close( $code );
362363 // Different keys may expire separately, at least in LCStore_Accel
363364 if ( $deps === null || $keys === null || $preload === null ) {
364365 wfDebug( __METHOD__."($code): cache missing, need to make one\n" );
@@ -1032,6 +1033,13 @@
10331034 }
10341035 }
10351036
 1037+ public function close( $code ) {
 1038+ if ( !isset( $this->readers[$code] ) ) {
 1039+ return;
 1040+ }
 1041+ $this->readers[$code]->close();
 1042+ }
 1043+
10361044 public function startWrite( $code ) {
10371045 if ( !file_exists( $this->directory ) ) {
10381046 if ( !wfMkdirParents( $this->directory, null, __METHOD__ ) ) {
@@ -1186,4 +1194,4 @@
11871195 $this->unload( $code );
11881196 }
11891197 }
1190 -}
\ No newline at end of file
 1198+}

Follow-up revisions

RevisionCommit summaryAuthorDate
r103687closing a store is only available for CDB type...hashar16:31, 19 November 2011

Status & tagging log