From 7fa9b4cf401e46471f74f0f1344c523f11726325 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sat, 19 Nov 2011 16:23:52 +0000 Subject: [PATCH] add possibility to close a LCStore_CDB also close an LCStore_CDB after checking for expiry --- includes/LocalisationCache.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/includes/LocalisationCache.php b/includes/LocalisationCache.php index ad707dc18a..828ed1c749 100644 --- a/includes/LocalisationCache.php +++ b/includes/LocalisationCache.php @@ -358,6 +358,7 @@ class LocalisationCache { $deps = $this->store->get( $code, 'deps' ); $keys = $this->store->get( $code, 'list', 'messages' ); $preload = $this->store->get( $code, 'preload' ); + $this->store->close( $code ); // Different keys may expire separately, at least in LCStore_Accel if ( $deps === null || $keys === null || $preload === null ) { wfDebug( __METHOD__."($code): cache missing, need to make one\n" ); @@ -1032,6 +1033,13 @@ class LCStore_CDB implements LCStore { } } + public function close( $code ) { + if ( !isset( $this->readers[$code] ) ) { + return; + } + $this->readers[$code]->close(); + } + public function startWrite( $code ) { if ( !file_exists( $this->directory ) ) { if ( !wfMkdirParents( $this->directory, null, __METHOD__ ) ) { @@ -1186,4 +1194,4 @@ class LocalisationCache_BulkLoad extends LocalisationCache { $this->unload( $code ); } } -} \ No newline at end of file +} -- 2.20.1