Add config value for cache gc ttl
This commit is contained in:
parent
f7d102ccc5
commit
299520b322
|
@ -969,6 +969,14 @@ $CONFIG = array(
|
||||||
*/
|
*/
|
||||||
'cache_path' => '',
|
'cache_path' => '',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TTL of files located in the cache folder before they're removed by
|
||||||
|
* garbage collection (in seconds). Increase this value if users have
|
||||||
|
* issues uploading very large files via the ownCloud Client as upload isn't
|
||||||
|
* completed within one day.
|
||||||
|
*/
|
||||||
|
'cache_folder_gc_ttl' => 86400, // 60*60*24 = 1 day
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Using Object Store with ownCloud
|
* Using Object Store with ownCloud
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -111,7 +111,7 @@ class File implements ICache {
|
||||||
$keyPart = $key . '.' . $uniqueId . '.part';
|
$keyPart = $key . '.' . $uniqueId . '.part';
|
||||||
if ($storage and $storage->file_put_contents($keyPart, $value)) {
|
if ($storage and $storage->file_put_contents($keyPart, $value)) {
|
||||||
if ($ttl === 0) {
|
if ($ttl === 0) {
|
||||||
$ttl = 86400; // 60*60*24
|
$ttl = \OC::$server->getConfig()->getSystemValue('cache_folder_gc_ttl', 86400);
|
||||||
}
|
}
|
||||||
$result = $storage->touch($keyPart, time() + $ttl);
|
$result = $storage->touch($keyPart, time() + $ttl);
|
||||||
$result &= $storage->rename($keyPart, $key);
|
$result &= $storage->rename($keyPart, $key);
|
||||||
|
|
Loading…
Reference in New Issue