dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a0c9fb5
)
Use WAN cache adaptiveTTL() method in FileBackendStore
author
Aaron Schulz
<aschulz@wikimedia.org>
Fri, 2 Sep 2016 22:59:52 +0000
(15:59 -0700)
committer
Aaron Schulz
<aschulz@wikimedia.org>
Fri, 2 Sep 2016 22:59:52 +0000
(15:59 -0700)
Change-Id: I2e8b4e85b12c8892e8640abc63ee13b4b170645d
includes/filebackend/FileBackendStore.php
patch
|
blob
|
history
diff --git
a/includes/filebackend/FileBackendStore.php
b/includes/filebackend/FileBackendStore.php
index
a29119c
..
db6575e
100644
(file)
--- a/
includes/filebackend/FileBackendStore.php
+++ b/
includes/filebackend/FileBackendStore.php
@@
-1702,8
+1702,8
@@
abstract class FileBackendStore extends FileBackend {
if ( $path === null ) {
return; // invalid storage path
}
- $
age = time() -
wfTimestamp( TS_UNIX, $val['mtime'] );
- $ttl =
min( 7 * 86400, max( 300, floor( .1 * $age ) )
);
+ $
mtime =
wfTimestamp( TS_UNIX, $val['mtime'] );
+ $ttl =
$this->memCache->adaptiveTTL( $mtime, 7 * 86400, 300, .1
);
$key = $this->fileCacheKey( $path );
// Set the cache unless it is currently salted.
$this->memCache->set( $key, $val, $ttl );