Skip to content

Commit

Permalink
Merge pull request #3422 from nextcloud/backport/3393/stable30
Browse files Browse the repository at this point in the history
[stable30] Fix labeled version autoExpire
  • Loading branch information
artonge authored Nov 13, 2024
2 parents 321b668 + bc3a0ae commit 465bda8
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 @@ -74,8 +74,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 465bda8

Please sign in to comment.