Skip to content

Commit

Permalink
Merge pull request #3421 from nextcloud/backport/3393/stable29
Browse files Browse the repository at this point in the history
[stable29] Fix labeled version autoExpire
  • Loading branch information
artonge authored Nov 13, 2024
2 parents e3f7e12 + 5c0bbc7 commit f08e815
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Versions/ExpireManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,11 @@ protected function getAutoExpireList(int $time, array $versions): array {
while ($newInterval) {
if ($nextInterval === -1 || $prevTimestamp > $nextInterval) {
if ($version->getTimestamp() > $nextVersion) {
//distance between two version too small, mark to delete
$toDelete[] = $version;
// Do not expire versions with a label.
if (!($version instanceof IMetadataVersion) || $version->getMetadataValue('label') === null || $version->getMetadataValue('label') === '') {
//distance between two version too small, mark to delete
$toDelete[] = $version;
}
} else {
$nextVersion = $version->getTimestamp() - $step;
$prevTimestamp = $version->getTimestamp();
Expand Down

0 comments on commit f08e815

Please sign in to comment.