Commit 8e077cf1 authored by Bjoern Schiessle's avatar Bjoern Schiessle
Browse files

make sure that we always delete oldest first

parent 9dea79e3
......@@ -517,6 +517,9 @@ class Storage {
// but always keep the two latest versions
$numOfVersions = count($allVersions) -2 ;
$i = 0;
// sort oldest first and make sure that we start at the first element
ksort($allVersions);
reset($allVersions);
while ($availableSpace < 0 && $i < $numOfVersions) {
$version = current($allVersions);
\OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $version['path'].'.v'.$version['version']));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment