mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 12:54:55 -04:00
Stagger send presence to remotes (#10398)
This is to help with performance, where trying to connect to thousands of hosts at once can consume a lot of CPU (due to TLS etc). Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
This commit is contained in:
parent
5ecad4e7a5
commit
ac5c221208
4 changed files with 116 additions and 5 deletions
|
@ -285,6 +285,10 @@ class PresenceRouterTestCase(FederatingHomeserverTestCase):
|
|||
presence_updates, _ = sync_presence(self, self.presence_receiving_user_two_id)
|
||||
self.assertEqual(len(presence_updates), 3)
|
||||
|
||||
# We stagger sending of presence, so we need to wait a bit for them to
|
||||
# get sent out.
|
||||
self.reactor.advance(60)
|
||||
|
||||
# Test that sending to a remote user works
|
||||
remote_user_id = "@far_away_person:island"
|
||||
|
||||
|
@ -301,6 +305,10 @@ class PresenceRouterTestCase(FederatingHomeserverTestCase):
|
|||
self.module_api.send_local_online_presence_to([remote_user_id])
|
||||
)
|
||||
|
||||
# We stagger sending of presence, so we need to wait a bit for them to
|
||||
# get sent out.
|
||||
self.reactor.advance(60)
|
||||
|
||||
# Check that the expected presence updates were sent
|
||||
# We explicitly compare using sets as we expect that calling
|
||||
# module_api.send_local_online_presence_to will create a presence
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue