This commit is contained in:
@@ -57,7 +57,7 @@ async fn connect_handler(
|
||||
ErrorUnauthorized("Unauthorized")
|
||||
})?;
|
||||
|
||||
let mut con = state.redis.get_async_connection().await.map_err(|e| {
|
||||
let mut con = state.redis.get_multiplexed_async_connection().await.map_err(|e| {
|
||||
eprintln!("Failed to get async connection: {}", e);
|
||||
ServerError("Internal Server Error")
|
||||
})?;
|
||||
@@ -80,8 +80,7 @@ async fn connect_handler(
|
||||
let (tx, rx) = broadcast::channel(100);
|
||||
let state_clone = state.clone();
|
||||
let handle = tokio::spawn(async move {
|
||||
let conn = state_clone.redis.get_async_connection().await.unwrap();
|
||||
let mut pubsub = conn.into_pubsub();
|
||||
let mut pubsub = state_clone.redis.get_async_pubsub().await.unwrap();
|
||||
let followers_channel = format!("follower:{}", listener_id);
|
||||
pubsub.subscribe(followers_channel.clone()).await.unwrap();
|
||||
println!("'{}' pubsub subscribed", followers_channel);
|
||||
|
Reference in New Issue
Block a user