Skip to content

Commit

Permalink
Merge pull request #3393 from XueSheng-GIT/fix-labeled-version-expiry
Browse files Browse the repository at this point in the history
Fix labeled version autoExpire
  • Loading branch information
artonge authored Nov 13, 2024
2 parents 939b6fd + 082d6d0 commit d49859f
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 @@ -66,8 +66,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 d49859f

Please sign in to comment.