refactor init_db and init_progress_bar

This commit is contained in:
Elijah McMorris 2024-08-27 15:51:51 -07:00
parent 731df97cd2
commit 2ded1d5b1b
Signed by: NexVeridian
SSH key fingerprint: SHA256:bsA1SKZxuEcEVHAy3gY1HUeM5ykRJl0U0kQHQn0hMg8
8 changed files with 103 additions and 134 deletions

View file

@ -3,6 +3,7 @@ use lazy_static::lazy_static;
use std::{env, io::BufRead};
use surrealdb::{engine::remote::ws::Client, Surreal};
use tokio::time::{sleep, Duration};
mod utils;
use utils::*;
@ -35,9 +36,9 @@ pub enum CreateMode {
#[tokio::main]
async fn main() -> Result<(), Error> {
sleep(Duration::from_secs(10)).await;
let pb = create_pb().await;
let pb = init_progress_bar::create_pb().await;
let db = create_db_ws().await?;
let db = init_db::create_db_ws().await?;
let reader = File_Format::new(&WIKIDATA_FILE_FORMAT).reader(&WIKIDATA_FILE_NAME)?;
match *CREATE_MODE {