Merge pull request #2079 from owncloud/fix_expire_function
fix expire function
This commit is contained in:
commit
b3df526ef2
1 changed files with 5 additions and 5 deletions
|
@ -442,12 +442,12 @@ class Storage {
|
|||
}
|
||||
}
|
||||
|
||||
// check if enough space is available after versions are rearranged.
|
||||
// if not we delete the oldest versions until we meet the size limit for versions
|
||||
$numOfVersions = count($all_versions);
|
||||
// Check if enough space is available after versions are rearranged.
|
||||
// If not we delete the oldest versions until we meet the size limit for versions,
|
||||
// but always keep the two latest versions
|
||||
$numOfVersions = count($all_versions) -2 ;
|
||||
$i = 0;
|
||||
while ($availableSpace < 0) {
|
||||
if ($i = $numOfVersions-2) break; // keep at least the last version
|
||||
while ($availableSpace < 0 && $i < $numOfVersions) {
|
||||
$versions_fileview->unlink($all_versions[$i]['path'].'.v'.$all_versions[$i]['version']);
|
||||
$versionsSize -= $all_versions[$i]['size'];
|
||||
$availableSpace += $all_versions[$i]['size'];
|
||||
|
|
Loading…
Reference in a new issue