summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-02-06 18:03:49 +0200
committerLars Wirzenius <liw@liw.fi>2021-02-06 18:15:44 +0200
commitad98db921aa3d710ad7c448c6a1b818f4359d73a (patch)
tree19a0ed284970b895245a1133af51b8ec0b4b5015 /src/bin
parentf1d1636beeddd56635f248bd0eb2b5841c65f562 (diff)
downloadobnam2-ad98db921aa3d710ad7c448c6a1b818f4359d73a.tar.gz
feat: use the chunk size setting from the client configuration
Use the chunk_size setting for file data. For the SQLite file, use a hard-coded size instead.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/obnam.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/bin/obnam.rs b/src/bin/obnam.rs
index 9c5d3f4..8778a73 100644
--- a/src/bin/obnam.rs
+++ b/src/bin/obnam.rs
@@ -6,8 +6,6 @@ use obnam::cmd::{backup, get_chunk, list, list_files, restore, show_config, show
use std::path::{Path, PathBuf};
use structopt::StructOpt;
-const BUFFER_SIZE: usize = 1024 * 1024;
-
fn main() -> anyhow::Result<()> {
let opt = Opt::from_args();
let config_file = match opt.config {
@@ -15,15 +13,13 @@ fn main() -> anyhow::Result<()> {
Some(ref path) => path.to_path_buf(),
};
let config = ClientConfig::read_config(&config_file)?;
- if let Some(ref log) = config.log {
- setup_logging(&log)?;
- }
+ setup_logging(&config.log)?;
info!("client starts");
debug!("{:?}", opt);
let result = match opt.cmd {
- Command::Backup => backup(&config, BUFFER_SIZE),
+ Command::Backup => backup(&config),
Command::List => list(&config),
Command::ShowGeneration { gen_id } => show_generation(&config, &gen_id),
Command::ListFiles { gen_id } => list_files(&config, &gen_id),