feat(persist): Add stage_and_commit to Persist

In the example_cli we were not always committing (seemingly by mistake).
This then caused all the examples to have to compensate by manually
committing.
This commit is contained in:
LLFourn
2024-01-19 11:23:46 +11:00
parent 0bee46e75b
commit e6433fb2c1
5 changed files with 21 additions and 19 deletions

View File

@@ -122,7 +122,7 @@ fn main() -> anyhow::Result<()> {
let electrum_cmd = match &args.command {
example_cli::Commands::ChainSpecific(electrum_cmd) => electrum_cmd,
general_cmd => {
let res = example_cli::handle_commands(
return example_cli::handle_commands(
&graph,
&db,
&chain,
@@ -135,9 +135,6 @@ fn main() -> anyhow::Result<()> {
},
general_cmd.clone(),
);
db.lock().unwrap().commit()?;
return res;
}
};