disable hotspot when no activity on webserver

This commit is contained in:
2025-06-01 15:42:13 +02:00
parent 3b3633f6f5
commit 3fe2f3f376
2 changed files with 45 additions and 12 deletions

View File

@@ -14,6 +14,7 @@ use tokio::select;
use tokio::sync::Mutex;
use tokio::sync::broadcast::Sender;
use crate::activity_fairing::ActivityNotifier;
use crate::id_mapping::{IDMapping, Name};
use crate::id_store::IDStore;
use crate::tally_id::TallyID;
@@ -31,6 +32,7 @@ struct NewMapping {
pub async fn start_webserver(
store: Arc<Mutex<IDStore>>,
sse_broadcaster: Sender<String>,
fairing: ActivityNotifier,
) -> Result<(), rocket::Error> {
let port = match env::var("HTTP_PORT") {
Ok(port) => port.parse().unwrap_or_else(|_| {
@@ -47,6 +49,7 @@ pub async fn start_webserver(
};
rocket::custom(config)
.attach(fairing)
.mount(
"/",
routes![