[Fix] Stability
This commit is contained in:
parent
6b4c144b73
commit
14df716cf1
19 changed files with 483 additions and 405 deletions
|
|
@ -7,7 +7,13 @@ use rand_core::{OsRng, RngCore};
|
|||
use rusqlite::params;
|
||||
|
||||
pub fn add_user(user: UserProfile) {
|
||||
if let Err(e) = db::with_db(|conn| {
|
||||
if let Err(e) = try_add_user(user) {
|
||||
eprintln!("Failed to add_user: {}", e);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn try_add_user(user: UserProfile) -> Result<(), crate::storage_error::StorageError> {
|
||||
db::with_db(|conn| {
|
||||
conn.execute(
|
||||
r#"
|
||||
INSERT INTO users (user_id, username, public_key, private_key_hash, reset_token, created_at, display_name)
|
||||
|
|
@ -40,9 +46,7 @@ pub fn add_user(user: UserProfile) {
|
|||
)?;
|
||||
}
|
||||
Ok(())
|
||||
}) {
|
||||
eprintln!("Failed to add_user: {}", e);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn update_user(user: UserProfile) {
|
||||
|
|
|
|||
|
|
@ -239,5 +239,3 @@ fn pending_forward_from_row(row: &rusqlite::Row<'_>) -> rusqlite::Result<Pending
|
|||
created_at: row.get(8)?,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue