Skip to content

Commit

Permalink
Working on v1.17.5
Browse files Browse the repository at this point in the history
  • Loading branch information
dialogflowchatbot committed Jan 1, 2025
1 parent 059a7e1 commit abe7997
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ candle-transformers = { version = "0.8" }
frand = "0.10"
tokenizers = "0.21"
# candle_embed = "0.1"
colored = "2.1"
colored = "2.2"
# dashmap = "5.5.1"
enum_dispatch = "0.3"
erased-serde = "0.4"
Expand All @@ -50,7 +50,7 @@ itoa = "1.0"
# once_cell = "1.20"
# ort = { version = "=2.0.0-rc.0", default-features = false }
# paste = "1.0"
redb = "2.3"
redb = "2.4"
regex = "1.11"
reqwest = { version = "0.12", features = ["stream"] }
rkyv = {version = "0.8", features = ["aligned", "alloc", "bytecheck"]}
Expand Down
16 changes: 14 additions & 2 deletions src/intent/phrase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,20 @@ pub(crate) async fn remove_by_intent_id(robot_id: &str, intent_id: &str) -> Resu

pub(crate) async fn remove_tables(robot_id: &str) -> Result<()> {
let sql = format!("DROP TABLE {}", robot_id);
sqlx::query::<Sqlite>(&sql)
match sqlx::query::<Sqlite>(&sql)
.execute(DATA_SOURCE.get().unwrap())
.await?;
.await {
Ok(_) => return Ok(()),
Err(e) => match e {
sqlx::Error::Database(database_error) => {
if let Some(code) = database_error.code() {
if code.eq("1") {
return Ok::<_, Error>(());
}
}
}
_ => return Err(e.into()),
},
};
Ok(())
}

0 comments on commit abe7997

Please sign in to comment.