websocket for single db update
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -21,9 +21,12 @@ use crate::utils::auth::JwtKeys;
|
||||
|
||||
|
||||
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
|
||||
|
||||
|
||||
let hotel_pools = HotelPool::new();
|
||||
let logs_manager = SqliteConnectionManager::file("db/auth.sqlite");
|
||||
let logs_pool = Pool::builder()
|
||||
@@ -31,13 +34,6 @@ async fn main() -> std::io::Result<()> {
|
||||
.build(logs_manager)
|
||||
.expect("Failed to build logs pool");
|
||||
|
||||
type UserMap = DashMap<i32, mpsc::UnboundedSender<Message>>;
|
||||
/// hotel_id → users
|
||||
type HotelMap = DashMap<i32, Arc<UserMap>>;
|
||||
/// global map of all hotels
|
||||
type WsMap = Arc<HotelMap>;
|
||||
|
||||
|
||||
let state = AppState {
|
||||
hotel_pools,
|
||||
logs_pool,
|
||||
|
||||
Reference in New Issue
Block a user