modularize frontend and implement new css and themes
This commit is contained in:
+2
-4
@@ -7,7 +7,8 @@ use std::{
|
||||
use tokio::sync::broadcast;
|
||||
|
||||
pub const RESET_EVENT: &str = "__reset__";
|
||||
pub const CHAT_RESET_INTERVAL: Duration = Duration::from_secs(3 * 60);
|
||||
// Changed from 3 minutes to 20 minutes
|
||||
pub const CHAT_RESET_INTERVAL: Duration = Duration::from_secs(20 * 60);
|
||||
pub const RATE_LIMIT_WINDOW: Duration = CHAT_RESET_INTERVAL;
|
||||
pub const MESSAGE_LIMIT_PER_WINDOW: u32 = 60;
|
||||
pub const SESSION_LIMIT_PER_WINDOW: u32 = 10;
|
||||
@@ -20,11 +21,8 @@ pub struct RateLimitEntry {
|
||||
|
||||
pub struct AppState {
|
||||
pub sessions: DashMap<String, ChatSession>,
|
||||
// broadcast channel: session_id -> sender
|
||||
pub notifiers: DashMap<String, broadcast::Sender<String>>,
|
||||
// supporter broadcast for new sessions and updates
|
||||
pub supporter_notifier: broadcast::Sender<String>,
|
||||
// in-memory rate limits, wiped with all other state every three minutes
|
||||
pub rate_limits: DashMap<String, RateLimitEntry>,
|
||||
reset_started: Mutex<Instant>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user