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