From fa1a0946b1dc1965712872e865e4ef9d17f57f92 Mon Sep 17 00:00:00 2001 From: Ethan O'Brien <77750390+ethanaobrien@users.noreply.github.com> Date: Fri, 26 Apr 2024 20:34:22 -0500 Subject: [PATCH] Cleanup gree --- src/router/gree.rs | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/router/gree.rs b/src/router/gree.rs index 2b60a3c..83b61f3 100644 --- a/src/router/gree.rs +++ b/src/router/gree.rs @@ -69,24 +69,7 @@ fn lock_and_select(command: &str, args: &[&dyn ToSql]) -> Result { - if result.is_none() { - init(&mut result); - } - let conn = result.as_ref().unwrap(); - conn.execute( - table, - (), - ).unwrap(); - return; - } - Err(_) => { - std::thread::sleep(std::time::Duration::from_millis(15)); - } - } - } + lock_and_exec(table, params!()); } fn uuid_exists(uuid: &str) -> bool { let data = lock_and_select("SELECT uuid FROM uuids WHERE uuid=?1", params!(uuid)); @@ -108,7 +91,7 @@ pub fn import_user(uid: i64) -> String { let token = get_new_uuid(); lock_and_exec( "INSERT INTO users (cert, uuid, user_id) VALUES (?1, ?2, ?3)", - params!("", token, uid) + params!("none", token, uid) ); token }