cleanup: define/use const for predefined blob file names.
This commit is contained in:
parent
7cc3473a4e
commit
96d65fbcd0
|
@ -44,7 +44,7 @@ fn read_backup_index(store: &DataStore, backup_dir: &BackupDir) -> Result<Vec<Ba
|
||||||
|
|
||||||
let mut path = store.base_path();
|
let mut path = store.base_path();
|
||||||
path.push(backup_dir.relative_path());
|
path.push(backup_dir.relative_path());
|
||||||
path.push("index.json.blob");
|
path.push(MANIFEST_BLOB_NAME);
|
||||||
|
|
||||||
let raw_data = file_get_contents(&path)?;
|
let raw_data = file_get_contents(&path)?;
|
||||||
let index_size = raw_data.len() as u64;
|
let index_size = raw_data.len() as u64;
|
||||||
|
@ -61,7 +61,7 @@ fn read_backup_index(store: &DataStore, backup_dir: &BackupDir) -> Result<Vec<Ba
|
||||||
}
|
}
|
||||||
|
|
||||||
result.push(BackupContent {
|
result.push(BackupContent {
|
||||||
filename: "index.json.blob".to_string(),
|
filename: MANIFEST_BLOB_NAME.to_string(),
|
||||||
size: Some(index_size),
|
size: Some(index_size),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -805,7 +805,7 @@ fn upload_backup_log(
|
||||||
let store = tools::required_string_param(¶m, "store")?;
|
let store = tools::required_string_param(¶m, "store")?;
|
||||||
let datastore = DataStore::lookup_datastore(store)?;
|
let datastore = DataStore::lookup_datastore(store)?;
|
||||||
|
|
||||||
let file_name = "client.log.blob";
|
let file_name = CLIENT_LOG_BLOB_NAME;
|
||||||
|
|
||||||
let backup_type = tools::required_string_param(¶m, "backup-type")?;
|
let backup_type = tools::required_string_param(¶m, "backup-type")?;
|
||||||
let backup_id = tools::required_string_param(¶m, "backup-id")?;
|
let backup_id = tools::required_string_param(¶m, "backup-id")?;
|
||||||
|
|
|
@ -7,6 +7,7 @@ use serde_json::{json, Value};
|
||||||
use crate::backup::BackupDir;
|
use crate::backup::BackupDir;
|
||||||
|
|
||||||
pub const MANIFEST_BLOB_NAME: &str = "index.json.blob";
|
pub const MANIFEST_BLOB_NAME: &str = "index.json.blob";
|
||||||
|
pub const CLIENT_LOG_BLOB_NAME: &str = "client.log.blob";
|
||||||
|
|
||||||
pub struct FileInfo {
|
pub struct FileInfo {
|
||||||
pub filename: String,
|
pub filename: String,
|
||||||
|
|
Loading…
Reference in New Issue