improvement: flush after every request that manipulates the db
This commit is contained in:
parent
b2a1505535
commit
6dbe195695
30 changed files with 216 additions and 105 deletions
|
@ -12,7 +12,7 @@ use rocket::put;
|
|||
feature = "conduit_bin",
|
||||
put("/_matrix/client/r0/sendToDevice/<_>/<_>", data = "<body>")
|
||||
)]
|
||||
pub fn send_event_to_device_route(
|
||||
pub async fn send_event_to_device_route(
|
||||
db: State<'_, Database>,
|
||||
body: Ruma<send_event_to_device::Request<'_>>,
|
||||
) -> ConduitResult<send_event_to_device::Response> {
|
||||
|
@ -66,5 +66,7 @@ pub fn send_event_to_device_route(
|
|||
db.transaction_ids
|
||||
.add_txnid(sender_user, sender_device, &body.txn_id, &[])?;
|
||||
|
||||
db.flush().await?;
|
||||
|
||||
Ok(send_event_to_device::Response.into())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue