[Pkg-owncloud-commits] [owncloud] 246/258: make sure that we always delete oldest first

David Prévot taffit at moszumanska.debian.org
Sat Oct 11 17:22:41 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit ecc7161611823f64d63df306e4086eee10435680
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date:   Thu Oct 9 19:15:58 2014 +0200

    make sure that we always delete oldest first
---
 apps/files_versions/lib/versions.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index 7fadf81..bdb2689 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -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']));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list