Skip to content

Commit

Permalink
Add info log before and after updating wiktionary.
Browse files Browse the repository at this point in the history
  • Loading branch information
ISibboI committed Aug 5, 2023
1 parent 415945b commit f28adc6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions backend/rvoc-backend/src/update_wiktionary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::path::PathBuf;

use diesel::{ExpressionMethods, NullableExpressionMethods, RunQueryDsl};
use tokio::fs;
use tracing::{debug, error, instrument, warn};
use tracing::{debug, error, info, instrument, warn};
use wiktionary_dump_parser::parser::parse_dump_file;
use wiktionary_dump_parser::{language_code::LanguageCode, urls::DumpBaseUrl};

Expand All @@ -12,7 +12,8 @@ use crate::{configuration::Configuration, error::RVocError};

#[instrument(err, skip(configuration))]
pub async fn run_update_wiktionary(configuration: &Configuration) -> RVocResult<()> {
debug!("Updating wiktionary data with configuration: {configuration:#?}");
info!("Updating wiktionary data");
debug!("Configuration: {configuration:#?}");

let new_dump_file = update_wiktionary_dump_files(configuration).await?;
// expect the extension to be ".tar.bz2", and replace it with ".log"
Expand Down Expand Up @@ -134,6 +135,8 @@ pub async fn run_update_wiktionary(configuration: &Configuration) -> RVocResult<
source: Box::new(error),
})?;

info!("Success!");

Ok(())
}

Expand Down

0 comments on commit f28adc6

Please sign in to comment.