From 49f7f9549c92423fc21385d483974ff4de2776a9 Mon Sep 17 00:00:00 2001 From: IAmTomahawkx Date: Thu, 12 Dec 2024 01:47:06 -0800 Subject: [PATCH] feat: env variable to not clear presences on bonfire boot --- crates/bonfire/src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/bonfire/src/main.rs b/crates/bonfire/src/main.rs index 62766cf7..f4e8a387 100644 --- a/crates/bonfire/src/main.rs +++ b/crates/bonfire/src/main.rs @@ -19,7 +19,10 @@ async fn main() { database::connect().await; // Clean up the current region information. - clear_region(None).await; + let no_clear_region = env::var("NO_CLEAR_PRESENCE").unwrap_or_else(|_| "0".into()) == "1"; + if !no_clear_region { + clear_region(None).await; + } // Setup a TCP listener to accept WebSocket connections on. // By default, we bind to port 14703 on all interfaces.