From 3b85fc2e175872a4c1eb9e9f63418cdd21d532fd Mon Sep 17 00:00:00 2001 From: IAmTomahawkx Date: Fri, 19 Jun 2026 22:44:46 -0700 Subject: [PATCH] chore: rename session keys in redis Signed-off-by: IAmTomahawkx --- crates/core/presence/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/core/presence/src/lib.rs b/crates/core/presence/src/lib.rs index 4c5ffda5..22bae671 100644 --- a/crates/core/presence/src/lib.rs +++ b/crates/core/presence/src/lib.rs @@ -30,7 +30,7 @@ pub async fn create_session(user_id: &str, flags: u8) -> (bool, u32) { if let Ok(mut conn) = get_connection().await { // Check whether this is the first session - let was_empty = __get_set_size(&mut conn, user_id).await == 0; + let was_empty = __get_set_size(&mut conn, &format!("sessions:{user_id}")).await == 0; // A session ID is comprised of random data and any flags ORed to the end let session_id = { @@ -39,7 +39,7 @@ pub async fn create_session(user_id: &str, flags: u8) -> (bool, u32) { }; // Add session to user's sessions and to the region - __add_to_set_u32(&mut conn, user_id, session_id).await; + __add_to_set_u32(&mut conn, &format!("sessions:{user_id}"), session_id).await; __add_to_set_string(&mut conn, ONLINE_SET, user_id).await; __add_to_set_string(&mut conn, ®ION_KEY, &format!("{user_id}:{session_id}")).await; info!("Created session for {user_id}, assigned them a session ID of {session_id}."); @@ -62,7 +62,7 @@ async fn delete_session_internal(user_id: &str, session_id: u32, skip_region: bo if let Ok(mut conn) = get_connection().await { // Remove the session - __remove_from_set_u32(&mut conn, user_id, session_id).await; + __remove_from_set_u32(&mut conn, &format!("sessions:{user_id}"), session_id).await; // Remove from the region if !skip_region {