Format Rust code using rustfmt

This commit is contained in:
github-actions[bot] 2023-12-26 18:31:55 +00:00 committed by GitHub
parent a13f116698
commit 7eb32e55ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -449,7 +449,7 @@ async fn check_caps(
} }
SqliteAction::Backup => { SqliteAction::Backup => {
// flushing WALs for backup // flushing WALs for backup
// check caps. // check caps.
for db_ref in open_dbs.iter() { for db_ref in open_dbs.iter() {
let db = db_ref.value().lock().await; let db = db_ref.value().lock().await;
db.execute("pragma wal_checkpoint", [])?; db.execute("pragma wal_checkpoint", [])?;

View File

@ -222,15 +222,17 @@ async fn handle_request(
if Path::new(&checkpoint_dir).exists() { if Path::new(&checkpoint_dir).exists() {
fs::remove_dir_all(&checkpoint_dir).await?; fs::remove_dir_all(&checkpoint_dir).await?;
} }
let checkpoint = Checkpoint::new(&db).map_err(|e| StateError::RocksDBError { let checkpoint = Checkpoint::new(&db).map_err(|e| StateError::RocksDBError {
action: "BackupCheckpointNew".into(), action: "BackupCheckpointNew".into(),
error: e.to_string(), error: e.to_string(),
})?; })?;
checkpoint.create_checkpoint(&checkpoint_dir).map_err(|e| StateError::RocksDBError { checkpoint.create_checkpoint(&checkpoint_dir).map_err(|e| {
action: "BackupCheckpointCreate".into(), StateError::RocksDBError {
error: e.to_string(), action: "BackupCheckpointCreate".into(),
error: e.to_string(),
}
})?; })?;
(serde_json::to_vec(&StateResponse::Backup).unwrap(), None) (serde_json::to_vec(&StateResponse::Backup).unwrap(), None)