clean pre-path_hash fscache entries
This commit is contained in:
parent
284955573c
commit
65eee1f69d
|
@ -67,8 +67,7 @@
|
|||
<field>
|
||||
<name>path_hash</name>
|
||||
<type>text</type>
|
||||
<default>
|
||||
</default>
|
||||
<default></default>
|
||||
<notnull>true</notnull>
|
||||
<length>32</length>
|
||||
</field>
|
||||
|
|
|
@ -17,6 +17,7 @@ if($force or !OC_FileCache::inCache('')){
|
|||
if(!$checkOnly){
|
||||
OC_DB::beginTransaction();
|
||||
OC_FileCache::scan('',$eventSource);
|
||||
OC_FileCache::clean();
|
||||
OC_DB::commit();
|
||||
$eventSource->send('success',true);
|
||||
}else{
|
||||
|
|
|
@ -637,6 +637,14 @@ class OC_FileCache{
|
|||
self::fileSystemWatcherWrite(array('path'=>$path),$root);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* clean old pre-path_hash entries
|
||||
*/
|
||||
public static function clean(){
|
||||
$query=OC_DB::prepare('DELETE FROM *PREFIX*fscache WHERE LENGTH(path_hash)<30');
|
||||
$query->execute();
|
||||
}
|
||||
}
|
||||
|
||||
//watch for changes and try to keep the cache up to date
|
||||
|
|
Loading…
Reference in New Issue