Skip to content

Commit

Permalink
Only delete versions smaller than the current active version (#34182)
Browse files Browse the repository at this point in the history
  • Loading branch information
menghaoranss authored Dec 27, 2024
1 parent 829099d commit 5d34661
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void switchActiveVersion(final Collection<MetaDataVersion> metaDataVersio
}
repository.persist(each.getActiveVersionNodePath(), each.getNextActiveVersion());
getVersions(each.getVersionsPath()).stream()
.filter(version -> !version.equals(each.getNextActiveVersion()))
.filter(version -> Integer.parseInt(version) < Integer.parseInt(each.getNextActiveVersion()))
.forEach(version -> repository.delete(each.getVersionsNodePath(version)));
}
}
Expand Down

0 comments on commit 5d34661

Please sign in to comment.