summaryrefslogtreecommitdiff
path: root/src/backup_run.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/backup_run.rs')
-rw-r--r--src/backup_run.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/backup_run.rs b/src/backup_run.rs
index 464179b..9454625 100644
--- a/src/backup_run.rs
+++ b/src/backup_run.rs
@@ -7,6 +7,7 @@ use crate::chunker::{ChunkerError, FileChunks};
use crate::chunkid::ChunkId;
use crate::client::{BackupClient, ClientError};
use crate::config::ClientConfig;
+use crate::db::DatabaseError;
use crate::dbgen::FileId;
use crate::error::ObnamError;
use crate::fsentry::{FilesystemEntry, FilesystemKind};
@@ -50,6 +51,10 @@ pub enum BackupError {
#[error(transparent)]
LocalGenerationError(#[from] LocalGenerationError),
+ /// An error using a Database.
+ #[error(transparent)]
+ Database(#[from] DatabaseError),
+
/// An error splitting data into chunks.
#[error(transparent)]
ChunkerError(#[from] ChunkerError),
@@ -127,7 +132,7 @@ impl<'a> BackupRun<'a> {
match genid {
None => {
// Create a new, empty generation.
- NascentGeneration::create(oldname)?;
+ NascentGeneration::create(oldname)?.close()?;
// Open the newly created empty generation.
Ok(LocalGeneration::open(oldname)?)
@@ -191,7 +196,9 @@ impl<'a> BackupRun<'a> {
}
}
}
- new.file_count()
+ let count = new.file_count();
+ new.close()?;
+ count
};
self.finish();
let gen_id = self.upload_nascent_generation(newpath).await?;