mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
remove unnecessary async and select!{}
This commit is contained in:
parent
a60501189d
commit
092315e2cd
2 changed files with 42 additions and 39 deletions
|
|
@ -1165,7 +1165,7 @@ impl KeyValueDatabase {
|
|||
|
||||
services().sending.start_handler();
|
||||
|
||||
Self::start_cleanup_task().await;
|
||||
Self::start_cleanup_task();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -1182,7 +1182,7 @@ impl KeyValueDatabase {
|
|||
}
|
||||
|
||||
#[tracing::instrument]
|
||||
pub(crate) async fn start_cleanup_task() {
|
||||
pub(crate) fn start_cleanup_task() {
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
#[cfg(unix)]
|
||||
|
|
|
|||
|
|
@ -239,8 +239,11 @@ impl Service {
|
|||
|
||||
if let Ok(Some(grapevine_room)) = services().admin.get_admin_room() {
|
||||
loop {
|
||||
tokio::select! {
|
||||
Some(event) = receiver.recv() => {
|
||||
let event = receiver
|
||||
.recv()
|
||||
.await
|
||||
.expect("admin command channel has been closed");
|
||||
|
||||
let message_content = match event {
|
||||
AdminRoomEvent::SendMessage(content) => content,
|
||||
AdminRoomEvent::ProcessMessage(room_message) => {
|
||||
|
|
@ -249,7 +252,8 @@ impl Service {
|
|||
};
|
||||
|
||||
let mutex_state = Arc::clone(
|
||||
services().globals
|
||||
services()
|
||||
.globals
|
||||
.roomid_mutex_state
|
||||
.write()
|
||||
.await
|
||||
|
|
@ -275,9 +279,8 @@ impl Service {
|
|||
&grapevine_room,
|
||||
&state_lock,
|
||||
)
|
||||
.await.unwrap();
|
||||
}
|
||||
}
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue