Skip to content

Commit

Permalink
Fix labeled version expiry
Browse files Browse the repository at this point in the history
Signed-off-by: XueSheng-GIT <[email protected]>
  • Loading branch information
XueSheng-GIT committed Oct 31, 2024
1 parent 87a4c02 commit 0be34e1
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->getMetadataValue('label') === null || $version->getMetadataValue('label') === '') {

Check failure on line 70 in lib/Versions/ExpireManager.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

UndefinedInterfaceMethod

lib/Versions/ExpireManager.php:70:21: UndefinedInterfaceMethod: Method OCA\Files_Versions\Versions\IVersion::getMetadataValue does not exist (see https://psalm.dev/181)

Check failure on line 70 in lib/Versions/ExpireManager.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

UndefinedInterfaceMethod

lib/Versions/ExpireManager.php:70:69: UndefinedInterfaceMethod: Method OCA\Files_Versions\Versions\IVersion::getMetadataValue does not exist (see https://psalm.dev/181)
//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 0be34e1

Please sign in to comment.