add: CACHE_BREAKER env var

This commit is contained in:
trisua 2025-06-22 18:53:02 -04:00
parent 69fc3ca490
commit aceb51c21c
7 changed files with 18 additions and 9 deletions

View file

@ -30,7 +30,7 @@ use tetratto_core::{
};
use tetratto_core::cache::redis::Commands;
use tetratto_shared::{
hash::{self, random_id},
hash::{hash, salt, random_id},
unix_epoch_timestamp,
};
@ -185,7 +185,7 @@ pub async fn append_associations_request(
// resolve tokens
for token in req.tokens {
let hashed = hash::hash(token);
let hashed = hash(token);
let user_from_token = match data.get_user_by_token(&hashed).await {
Ok(ua) => ua,
Err(_) => continue,
@ -556,7 +556,7 @@ pub async fn subscription_handler(
pub async fn handle_socket(socket: WebSocket, db: DataManager, user_id: String, stream_id: String) {
let (mut sink, mut stream) = socket.split();
let socket_id = tetratto_shared::hash::salt();
let socket_id = salt();
db.0.1
.incr("atto.active_connections:users".to_string())
.await;