forked from kent/consciousness
Convert cmd_import, cmd_export, MigrateTranscriptProgress to access_local()
These were the last Store::load() calls that should use the shared store. Remaining calls are intentional: fsck (needs both cached and fresh), persist.rs cached() infrastructure, view.rs read-only fallback, and access() bootstrap path. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
b8db8754be
commit
f6f330b07b
2 changed files with 10 additions and 7 deletions
|
|
@ -349,12 +349,13 @@ pub async fn cmd_daily_check() -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn cmd_import(files: &[String]) -> Result<()> {
|
||||
pub async fn cmd_import(files: &[String]) -> Result<()> {
|
||||
if files.is_empty() {
|
||||
anyhow::bail!("import requires at least one file path");
|
||||
}
|
||||
|
||||
let mut store = store::Store::load()?;
|
||||
let arc = memory::access_local()?;
|
||||
let mut store = arc.lock().await;
|
||||
let mut total_new = 0;
|
||||
let mut total_updated = 0;
|
||||
|
||||
|
|
@ -382,8 +383,9 @@ pub fn cmd_import(files: &[String]) -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn cmd_export(files: &[String], export_all: bool) -> Result<()> {
|
||||
let store = store::Store::load()?;
|
||||
pub async fn cmd_export(files: &[String], export_all: bool) -> Result<()> {
|
||||
let arc = memory::access_local()?;
|
||||
let store = arc.lock().await;
|
||||
|
||||
let targets: Vec<String> = if export_all {
|
||||
let mut files: Vec<String> = store.nodes.keys()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue