mirror of
https://github.com/NexVeridian/wikidata-to-surrealdb.git
synced 2025-09-02 01:49:13 +00:00
fix tokio::fs
This commit is contained in:
parent
64d13fff58
commit
057dcb3308
2 changed files with 7 additions and 6 deletions
|
@ -9,7 +9,7 @@ anyhow = "1.0"
|
|||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
surrealdb-alpha = { version = "2.0.9", features = ["protocol-ws", "kv-mem"] }
|
||||
tokio = { version = "1.39", features = ["time"] }
|
||||
tokio = { version = "1.39", features = ["fs", "time"] }
|
||||
futures = "0.3"
|
||||
wikidata = "1.1"
|
||||
bzip2 = { version = "0.4", features = ["tokio"] }
|
||||
|
|
11
src/utils.rs
11
src/utils.rs
|
@ -184,11 +184,12 @@ pub async fn create_db_entities_bulk_filter(
|
|||
.map(char::from)
|
||||
.collect();
|
||||
|
||||
db_mem
|
||||
.export(format!("../data/temp/{}.surql", file_name))
|
||||
.await?;
|
||||
db.import(format!("../data/temp{}.surql", file_name))
|
||||
.await?;
|
||||
let file_path = format!("data/temp/{}.surql", file_name);
|
||||
|
||||
db_mem.export(&file_path).await?;
|
||||
db.import(&file_path).await?;
|
||||
|
||||
tokio::fs::remove_file(&file_path).await?;
|
||||
|
||||
if let Some(ref p) = pb {
|
||||
p.inc(batch_size as u64)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue