Skip to content

Commit

Permalink
Fix labeled version expiry
Browse files Browse the repository at this point in the history
Co-authored-by: Louis <louis@chmn.me>
Signed-off-by: XueSheng-GIT <Michael.Frase@gmx.de>
  • Loading branch information
XueSheng-GIT and artonge committed Nov 5, 2024
1 parent 87a4c02 commit 082d6d0
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 082d6d0

Please sign in to comment.