mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-03-24 20:14:50 +03:00
fmt
This commit is contained in:
parent
a55dec9035
commit
5ec0be2b41
4 changed files with 27 additions and 11 deletions
src
|
@ -340,7 +340,9 @@ impl Database {
|
|||
guard.rooms.edus.presenceid_presence.clear()?;
|
||||
|
||||
guard.admin.start_handler(Arc::clone(&db), admin_receiver);
|
||||
guard.sending.start_handler(Arc::clone(&db), sending_receiver);
|
||||
guard
|
||||
.sending
|
||||
.start_handler(Arc::clone(&db), sending_receiver);
|
||||
|
||||
drop(guard);
|
||||
|
||||
|
|
|
@ -35,8 +35,9 @@ impl Admin {
|
|||
|
||||
let guard = db.read().await;
|
||||
|
||||
let conduit_user = UserId::try_from(format!("@conduit:{}", guard.globals.server_name()))
|
||||
.expect("@conduit:server_name is valid");
|
||||
let conduit_user =
|
||||
UserId::try_from(format!("@conduit:{}", guard.globals.server_name()))
|
||||
.expect("@conduit:server_name is valid");
|
||||
|
||||
let conduit_room = guard
|
||||
.rooms
|
||||
|
@ -53,9 +54,7 @@ impl Admin {
|
|||
|
||||
drop(guard);
|
||||
|
||||
let send_message = |message: message::MessageEventContent| {
|
||||
|
||||
};
|
||||
let send_message = |message: message::MessageEventContent| {};
|
||||
|
||||
loop {
|
||||
tokio::select! {
|
||||
|
|
|
@ -30,7 +30,10 @@ use ruma::{
|
|||
receipt::ReceiptType,
|
||||
MilliSecondsSinceUnixEpoch, ServerName, UInt, UserId,
|
||||
};
|
||||
use tokio::{select, sync::{Semaphore, RwLock}};
|
||||
use tokio::{
|
||||
select,
|
||||
sync::{RwLock, Semaphore},
|
||||
};
|
||||
|
||||
use super::abstraction::Tree;
|
||||
|
||||
|
@ -90,7 +93,11 @@ enum TransactionStatus {
|
|||
}
|
||||
|
||||
impl Sending {
|
||||
pub fn start_handler(&self, db: Arc<RwLock<Database>>, mut receiver: mpsc::UnboundedReceiver<Vec<u8>>) {
|
||||
pub fn start_handler(
|
||||
&self,
|
||||
db: Arc<RwLock<Database>>,
|
||||
mut receiver: mpsc::UnboundedReceiver<Vec<u8>>,
|
||||
) {
|
||||
tokio::spawn(async move {
|
||||
let mut futures = FuturesUnordered::new();
|
||||
|
||||
|
@ -102,7 +109,8 @@ impl Sending {
|
|||
let guard = db.read().await;
|
||||
|
||||
for (key, outgoing_kind, event) in
|
||||
guard.sending
|
||||
guard
|
||||
.sending
|
||||
.servercurrentevents
|
||||
.iter()
|
||||
.filter_map(|(key, _)| {
|
||||
|
@ -132,7 +140,11 @@ impl Sending {
|
|||
for (outgoing_kind, events) in initial_transactions {
|
||||
current_transaction_status
|
||||
.insert(outgoing_kind.get_prefix(), TransactionStatus::Running);
|
||||
futures.push(Self::handle_events(outgoing_kind.clone(), events, Arc::clone(&db)));
|
||||
futures.push(Self::handle_events(
|
||||
outgoing_kind.clone(),
|
||||
events,
|
||||
Arc::clone(&db),
|
||||
));
|
||||
}
|
||||
|
||||
loop {
|
||||
|
|
|
@ -12,7 +12,10 @@ mod pdu;
|
|||
mod ruma_wrapper;
|
||||
mod utils;
|
||||
|
||||
use std::{sync::{Arc, Weak}, time::{Duration, Instant}};
|
||||
use std::{
|
||||
sync::{Arc, Weak},
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
|
||||
use database::Config;
|
||||
pub use database::Database;
|
||||
|
|
Loading…
Reference in a new issue