Skip to content

Commit

Permalink
remove invalid subtraction from release discard handler
Browse files Browse the repository at this point in the history
The subtraction was necessary when initially planned as the parsing of the release ids from the directories was happening after the check. Now that the ids are parsed while filtering the initial read result, there is no need anymore to remove one directory as the ".easydep_base_repo" directory name cannot be parsed as an u64 and will therefore get filtered out prior to the check.
  • Loading branch information
derklaro committed Mar 15, 2023
1 parent fe7acb7 commit a976e76
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/handler/release_discard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ pub(crate) fn discord_oldest_release(options: &Options) -> anyhow::Result<(), an
})
.collect();

// check if there is a need to discord some entries
// we subtract one entry here as it is the base git repository which does not count
let stored_releases = release_directories.len().saturating_sub(1);
// check if there is a need to discard some entries
let stored_releases = release_directories.len();
if max_stored_releases >= stored_releases {
info!(
"No need to remove any release (stored releases: {}, number of releases to keep: {})",
Expand Down

0 comments on commit a976e76

Please sign in to comment.