mirror of
https://github.com/modrinth/code.git
synced 2026-09-05 06:19:11 +00:00
feat(labrinth): Redis Cluster (#6771)
* chore(labrinth): bump to redis 1.4.1 * feat(labrinth): redis cluster * chore: cleanup * feat(labrinth): cache locking * fix(labrinth): clippy * chore(labrinth): cleanup env, remove postcard support * chore(ci): fix test env for labrinth * chore(labrinth): bump all key versions * chore(labrinth): improve redis key identities handling * chore(labrinth): simplify deadline handling * chore(labrinth): remove unused lease tracking * chore(labrinth): remove distributed cache locking for now * chore(labrinth): improve redis backend init error * feat(labrinth): expose redis read replica strategy * chore(ci): remove other connection mode tests * chore: split xredis crate * feat(xredis): primaries routing * chore: tombi fmt * chore: clippy * chore: update query cache
This commit is contained in:
@@ -4,12 +4,12 @@ use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use actix_web::web;
|
||||
use database::redis::RedisPool;
|
||||
use queue::{
|
||||
analytics::AnalyticsQueue, email::EmailQueue, payouts::PayoutsQueue,
|
||||
session::AuthQueue, socket::ActiveSockets,
|
||||
};
|
||||
use tracing::{debug, info, warn};
|
||||
use xredis::RedisPool;
|
||||
|
||||
extern crate clickhouse as clickhouse_crate;
|
||||
use clickhouse_crate::Client;
|
||||
@@ -26,7 +26,7 @@ use crate::util::archon::ArchonClient;
|
||||
use crate::util::http::HttpClient;
|
||||
use crate::util::ratelimit::{AsyncRateLimiter, GCRAParameters};
|
||||
use crate::util::tiltify::TiltifyClient;
|
||||
use sync::friends::handle_pubsub;
|
||||
use sync::friends::{FRIENDS_CHANNEL_NAME, handle_pubsub};
|
||||
use url::Url;
|
||||
use webauthn_rs::{Webauthn, WebauthnBuilder};
|
||||
|
||||
@@ -290,11 +290,10 @@ pub fn app_setup(
|
||||
|
||||
{
|
||||
let pool = pool.clone();
|
||||
let redis_client = redis::Client::open(redis_pool.url.clone()).unwrap();
|
||||
let pubsub_messages = redis_pool.subscribe(FRIENDS_CHANNEL_NAME);
|
||||
let sockets = active_sockets.clone();
|
||||
actix_rt::spawn(async move {
|
||||
let pubsub = redis_client.get_async_pubsub().await.unwrap();
|
||||
handle_pubsub(pubsub, pool, sockets).await;
|
||||
handle_pubsub(pubsub_messages, pool, sockets).await;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user