mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-05-13 11:37:33 -05:00
Cleanup gree
This commit is contained in:
parent
ab3bcef17f
commit
fa1a0946b1
1 changed files with 2 additions and 19 deletions
|
@ -69,24 +69,7 @@ fn lock_and_select(command: &str, args: &[&dyn ToSql]) -> Result<String, rusqlit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn create_store_v2(table: &str) {
|
fn create_store_v2(table: &str) {
|
||||||
loop {
|
lock_and_exec(table, params!());
|
||||||
match ENGINE.lock() {
|
|
||||||
Ok(mut 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));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
fn uuid_exists(uuid: &str) -> bool {
|
fn uuid_exists(uuid: &str) -> bool {
|
||||||
let data = lock_and_select("SELECT uuid FROM uuids WHERE uuid=?1", params!(uuid));
|
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();
|
let token = get_new_uuid();
|
||||||
lock_and_exec(
|
lock_and_exec(
|
||||||
"INSERT INTO users (cert, uuid, user_id) VALUES (?1, ?2, ?3)",
|
"INSERT INTO users (cert, uuid, user_id) VALUES (?1, ?2, ?3)",
|
||||||
params!("", token, uid)
|
params!("none", token, uid)
|
||||||
);
|
);
|
||||||
token
|
token
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue