improvement: batch inserts for inserting pdus

This commit is contained in:
Timo Kösters 2021-09-14 14:23:43 +02:00
parent 159e22e450
commit 5c02dc7830
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
4 changed files with 30 additions and 23 deletions

View file

@ -2104,13 +2104,12 @@ impl Rooms {
// where events in the current room state do not exist
self.set_room_state(room_id, statehashid)?;
for server in self
let servers = self
.room_servers(room_id)
.filter_map(|r| r.ok())
.filter(|server| &**server != db.globals.server_name())
{
db.sending.send_pdu(&server, &pdu_id)?;
}
.filter(|server| &**server != db.globals.server_name());
db.sending.send_pdu(servers, &pdu_id)?;
for appservice in db.appservice.all()? {
if self.appservice_in_room(room_id, &appservice, db)? {