aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-05-25 11:07:31 +0200
committerVincent Petry <pvince81@owncloud.com>2016-05-25 11:07:31 +0200
commitb5f455f5ac31ea3a35b8adc70ae82d8e4d31920f (patch)
tree44f86a11a989b594dfcd164b6071ecedd2ff7ed4 /lib/private
parent25f31107301b3ed08cbd9ade2a4bf37e88e54044 (diff)
parent51b0036d8f714e3693be744784f65c34dee64afa (diff)
downloadnextcloud-server-b5f455f5ac31ea3a35b8adc70ae82d8e4d31920f.tar.gz
nextcloud-server-b5f455f5ac31ea3a35b8adc70ae82d8e4d31920f.zip
Merge pull request #24812 from owncloud/fkammer-enhancement-cache-folder-gc-ttl
Make chunk cache ttl configurable
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/legacy/filechunking.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/legacy/filechunking.php b/lib/private/legacy/filechunking.php
index f2cef275458..9b8a5a6f766 100644
--- a/lib/private/legacy/filechunking.php
+++ b/lib/private/legacy/filechunking.php
@@ -31,6 +31,13 @@ class OC_FileChunking {
protected $info;
protected $cache;
+ /**
+ * TTL of chunks
+ *
+ * @var int
+ */
+ protected $ttl;
+
static public function decodeName($name) {
preg_match('/(?P<name>.*)-chunking-(?P<transferid>\d+)-(?P<chunkcount>\d+)-(?P<index>\d+)/', $name, $matches);
return $matches;
@@ -41,6 +48,7 @@ class OC_FileChunking {
*/
public function __construct($info) {
$this->info = $info;
+ $this->ttl = \OC::$server->getConfig()->getSystemValue('cache_chunk_gc_ttl', 86400);
}
public function getPrefix() {
@@ -67,7 +75,7 @@ class OC_FileChunking {
public function store($index, $data) {
$cache = $this->getCache();
$name = $this->getPrefix().$index;
- $cache->set($name, $data);
+ $cache->set($name, $data, $this->ttl);
return $cache->size($name);
}