opt: use database connection pool

This commit is contained in:
2022-03-16 18:30:56 +08:00
parent fe8778380c
commit 658e5b5902
7 changed files with 29 additions and 29 deletions

View File

@@ -2,9 +2,10 @@ use crate::api::{CurrentUser, API};
use crate::random_hasher::RandomHasher;
use rocket::serde::json::{json, Value};
use rocket::State;
use crate::db_conn::DbConn;
#[get("/systemlog")]
pub fn get_systemlog(user: CurrentUser, rh: &State<RandomHasher>) -> API<Value> {
pub fn get_systemlog(user: CurrentUser, rh: &State<RandomHasher>, conn: DbConn) -> API<Value> {
Ok(json!({
"tmp_token": rh.get_tmp_token(),
"salt": look!(rh.salt),