Skip to content

Commit d49859f

Browse files
authored
Merge pull request #3393 from XueSheng-GIT/fix-labeled-version-expiry
Fix labeled version autoExpire
2 parents 939b6fd + 082d6d0 commit d49859f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/Versions/ExpireManager.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@ protected function getAutoExpireList(int $time, array $versions): array {
6666
while ($newInterval) {
6767
if ($nextInterval === -1 || $prevTimestamp > $nextInterval) {
6868
if ($version->getTimestamp() > $nextVersion) {
69-
//distance between two version too small, mark to delete
70-
$toDelete[] = $version;
69+
// Do not expire versions with a label.
70+
if (!($version instanceof IMetadataVersion) || $version->getMetadataValue('label') === null || $version->getMetadataValue('label') === '') {
71+
//distance between two version too small, mark to delete
72+
$toDelete[] = $version;
73+
}
7174
} else {
7275
$nextVersion = $version->getTimestamp() - $step;
7376
$prevTimestamp = $version->getTimestamp();

0 commit comments

Comments
 (0)