Skip to content

Commit

Permalink
A0-3514: Don't log old backups not existing (#1499)
Browse files Browse the repository at this point in the history
# Description

Do not try to remove backups if they're not there.

## Type of change

- Bug fix (non-breaking change which fixes an issue)

Co-authored-by: Damian Leśniak <[email protected]>
  • Loading branch information
lesniak43 and Damian Leśniak authored Nov 21, 2023
1 parent e556f32 commit 7fb10ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions finality-aleph/src/party/backup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ pub fn rotate(
/// This should be done at the beginning of the new session.
pub fn remove_old_backups(path: Option<PathBuf>, current_session: u32) -> io::Result<()> {
if let Some(path) = path {
if !path.exists() {
return Ok(());
}
for read_dir in fs::read_dir(path)? {
let item = read_dir?;
match item.file_name().to_str() {
Expand Down

0 comments on commit 7fb10ab

Please sign in to comment.