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

@@ -125,7 +125,7 @@ fn main() -> anyhow::Result<()> {
example_cli::Commands::ChainSpecific(esplora_cmd) => esplora_cmd,
// These are general commands handled by example_cli. Execute the cmd and return.
general_cmd => {
let res = example_cli::handle_commands(
return example_cli::handle_commands(
&graph,
&db,
&chain,
@@ -140,9 +140,6 @@ fn main() -> anyhow::Result<()> {
},
general_cmd.clone(),
);
db.lock().unwrap().commit()?;
return res;
}
};