Skip to content

Commit bc3a0ae

Browse files
XueSheng-GITartonge
authored andcommitted
Fix labeled version expiry
Co-authored-by: Louis <[email protected]> Signed-off-by: XueSheng-GIT <[email protected]>
1 parent 321b668 commit bc3a0ae

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
@@ -74,8 +74,11 @@ protected function getAutoExpireList(int $time, array $versions): array {
7474
while ($newInterval) {
7575
if ($nextInterval === -1 || $prevTimestamp > $nextInterval) {
7676
if ($version->getTimestamp() > $nextVersion) {
77-
//distance between two version too small, mark to delete
78-
$toDelete[] = $version;
77+
// Do not expire versions with a label.
78+
if (!($version instanceof IMetadataVersion) || $version->getMetadataValue('label') === null || $version->getMetadataValue('label') === '') {
79+
//distance between two version too small, mark to delete
80+
$toDelete[] = $version;
81+
}
7982
} else {
8083
$nextVersion = $version->getTimestamp() - $step;
8184
$prevTimestamp = $version->getTimestamp();

0 commit comments

Comments
 (0)