mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-08-11 17:50:59 +00:00
remove eldrich being and install good being
This commit is contained in:
parent
9df86c2c1e
commit
14e6afc45e
34 changed files with 371 additions and 315 deletions
|
@ -1,5 +1,5 @@
|
|||
use super::State;
|
||||
use crate::{ConduitResult, Database, Error, Result, Ruma, RumaResponse};
|
||||
use crate::{database::ReadGuard, ConduitResult, Database, Error, Result, Ruma, RumaResponse};
|
||||
use log::error;
|
||||
use ruma::{
|
||||
api::client::r0::{sync::sync_events, uiaa::UiaaResponse},
|
||||
|
@ -35,13 +35,15 @@ use rocket::{get, tokio};
|
|||
)]
|
||||
#[tracing::instrument(skip(db, body))]
|
||||
pub async fn sync_events_route(
|
||||
db: State<'_, Arc<Database>>,
|
||||
db: ReadGuard,
|
||||
body: Ruma<sync_events::Request<'_>>,
|
||||
) -> std::result::Result<RumaResponse<sync_events::Response>, RumaResponse<UiaaResponse>> {
|
||||
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
|
||||
let sender_device = body.sender_device.as_ref().expect("user is authenticated");
|
||||
|
||||
let mut rx = match db
|
||||
let arc_db = Arc::new(db);
|
||||
|
||||
let mut rx = match arc_db
|
||||
.globals
|
||||
.sync_receivers
|
||||
.write()
|
||||
|
@ -52,7 +54,7 @@ pub async fn sync_events_route(
|
|||
let (tx, rx) = tokio::sync::watch::channel(None);
|
||||
|
||||
tokio::spawn(sync_helper_wrapper(
|
||||
Arc::clone(&db),
|
||||
Arc::clone(&arc_db),
|
||||
sender_user.clone(),
|
||||
sender_device.clone(),
|
||||
body.since.clone(),
|
||||
|
@ -68,7 +70,7 @@ pub async fn sync_events_route(
|
|||
let (tx, rx) = tokio::sync::watch::channel(None);
|
||||
|
||||
tokio::spawn(sync_helper_wrapper(
|
||||
Arc::clone(&db),
|
||||
Arc::clone(&arc_db),
|
||||
sender_user.clone(),
|
||||
sender_device.clone(),
|
||||
body.since.clone(),
|
||||
|
@ -104,7 +106,7 @@ pub async fn sync_events_route(
|
|||
}
|
||||
|
||||
pub async fn sync_helper_wrapper(
|
||||
db: Arc<Database>,
|
||||
db: Arc<ReadGuard>,
|
||||
sender_user: UserId,
|
||||
sender_device: Box<DeviceId>,
|
||||
since: Option<String>,
|
||||
|
@ -146,7 +148,7 @@ pub async fn sync_helper_wrapper(
|
|||
}
|
||||
|
||||
async fn sync_helper(
|
||||
db: Arc<Database>,
|
||||
db: Arc<ReadGuard>,
|
||||
sender_user: UserId,
|
||||
sender_device: Box<DeviceId>,
|
||||
since: Option<String>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue