websocket for single db update

This commit is contained in:
2025-09-26 04:05:22 +02:00
parent 65146fce91
commit a3b55f00df
6 changed files with 38 additions and 23 deletions

View File

@@ -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,