mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-11-16 15:11:24 +01:00
perf: remove unnecessary async
This commit is contained in:
parent
17dd8cb918
commit
07bb369c5c
2 changed files with 30 additions and 42 deletions
|
@ -1197,14 +1197,11 @@ pub async fn sync_events_v4_route(
|
||||||
|
|
||||||
if globalsince == 0 {
|
if globalsince == 0 {
|
||||||
if let Some(conn_id) = &body.conn_id {
|
if let Some(conn_id) = &body.conn_id {
|
||||||
services()
|
services().users.forget_sync_request_connection(
|
||||||
.users
|
|
||||||
.forget_sync_request_connection(
|
|
||||||
sender_user.clone(),
|
sender_user.clone(),
|
||||||
sender_device.clone(),
|
sender_device.clone(),
|
||||||
conn_id.clone(),
|
conn_id.clone(),
|
||||||
)
|
)
|
||||||
.await
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1474,17 +1471,14 @@ pub async fn sync_events_v4_route(
|
||||||
);
|
);
|
||||||
|
|
||||||
if let Some(conn_id) = &body.conn_id {
|
if let Some(conn_id) = &body.conn_id {
|
||||||
services()
|
services().users.update_sync_known_rooms(
|
||||||
.users
|
|
||||||
.update_sync_known_rooms(
|
|
||||||
sender_user.clone(),
|
sender_user.clone(),
|
||||||
sender_device.clone(),
|
sender_device.clone(),
|
||||||
conn_id.clone(),
|
conn_id.clone(),
|
||||||
list_id,
|
list_id,
|
||||||
new_known_rooms,
|
new_known_rooms,
|
||||||
globalsince,
|
globalsince,
|
||||||
)
|
);
|
||||||
.await;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1516,29 +1510,23 @@ pub async fn sync_events_v4_route(
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(conn_id) = &body.conn_id {
|
if let Some(conn_id) = &body.conn_id {
|
||||||
services()
|
services().users.update_sync_known_rooms(
|
||||||
.users
|
|
||||||
.update_sync_known_rooms(
|
|
||||||
sender_user.clone(),
|
sender_user.clone(),
|
||||||
sender_device.clone(),
|
sender_device.clone(),
|
||||||
conn_id.clone(),
|
conn_id.clone(),
|
||||||
"subscriptions".to_owned(),
|
"subscriptions".to_owned(),
|
||||||
known_subscription_rooms,
|
known_subscription_rooms,
|
||||||
globalsince,
|
globalsince,
|
||||||
)
|
);
|
||||||
.await;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(conn_id) = &body.conn_id {
|
if let Some(conn_id) = &body.conn_id {
|
||||||
services()
|
services().users.update_sync_subscriptions(
|
||||||
.users
|
|
||||||
.update_sync_subscriptions(
|
|
||||||
sender_user.clone(),
|
sender_user.clone(),
|
||||||
sender_device.clone(),
|
sender_device.clone(),
|
||||||
conn_id.clone(),
|
conn_id.clone(),
|
||||||
body.room_subscriptions,
|
body.room_subscriptions,
|
||||||
)
|
);
|
||||||
.await;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut rooms = BTreeMap::new();
|
let mut rooms = BTreeMap::new();
|
||||||
|
|
|
@ -45,7 +45,7 @@ impl Service {
|
||||||
self.db.exists(user_id)
|
self.db.exists(user_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn forget_sync_request_connection(
|
pub fn forget_sync_request_connection(
|
||||||
&self,
|
&self,
|
||||||
user_id: OwnedUserId,
|
user_id: OwnedUserId,
|
||||||
device_id: OwnedDeviceId,
|
device_id: OwnedDeviceId,
|
||||||
|
@ -186,7 +186,7 @@ impl Service {
|
||||||
cached.known_rooms.clone()
|
cached.known_rooms.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn update_sync_subscriptions(
|
pub fn update_sync_subscriptions(
|
||||||
&self,
|
&self,
|
||||||
user_id: OwnedUserId,
|
user_id: OwnedUserId,
|
||||||
device_id: OwnedDeviceId,
|
device_id: OwnedDeviceId,
|
||||||
|
@ -212,7 +212,7 @@ impl Service {
|
||||||
cached.subscriptions = subscriptions;
|
cached.subscriptions = subscriptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn update_sync_known_rooms(
|
pub fn update_sync_known_rooms(
|
||||||
&self,
|
&self,
|
||||||
user_id: OwnedUserId,
|
user_id: OwnedUserId,
|
||||||
device_id: OwnedDeviceId,
|
device_id: OwnedDeviceId,
|
||||||
|
|
Loading…
Reference in a new issue