mirror of
https://github.com/Qortal/qortal.git
synced 2025-02-15 11:45:49 +00:00
Fix DB backups not happening when no previous backup exists.
This commit is contained in:
parent
671dc5995a
commit
33f3d35784
@ -4,6 +4,7 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.NoSuchFileException;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
@ -264,6 +265,8 @@ public class HSQLDBRepository implements Repository {
|
|||||||
.map(Path::toFile)
|
.map(Path::toFile)
|
||||||
.filter(file -> file.getPath().startsWith(backupDirPathname))
|
.filter(file -> file.getPath().startsWith(backupDirPathname))
|
||||||
.forEach(File::delete);
|
.forEach(File::delete);
|
||||||
|
} catch (NoSuchFileException e) {
|
||||||
|
// Nothing to remove
|
||||||
} catch (SQLException | IOException e) {
|
} catch (SQLException | IOException e) {
|
||||||
throw new DataException("Unable to remove previous repository backup");
|
throw new DataException("Unable to remove previous repository backup");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user