diff options
author | 2022-04-23 14:24:20 +0400 | |
---|---|---|
committer | 2022-04-23 15:05:42 +0400 | |
commit | 8f9f25a796f6cc07f01f8f7f56e825cb5ebf56c8 (patch) | |
tree | cfe5e3ba5ddc56aadf3062fdde26baea10908335 /tests/helpers.py | |
parent | Add support for BIG SOLIDUS unicode characters in off topic names (#2146) (diff) |
Speed Up Sync Cog Loading
The user syncer was blocking the startup of the sync cog due to having
to perform thousands of pointless member fetch requests. This speeds up
that process by increasing the probability that the cache is up-to-date
using `Guild.chunked`, and limiting the fetches to members who were in
the guild during the previous sync only.
Co-authored-by: ChrisJL <[email protected]>
Co-authored-by: wookie184 <[email protected]>
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'tests/helpers.py')
-rw-r--r-- | tests/helpers.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/helpers.py b/tests/helpers.py index a6e4bdd66..5f3111616 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -171,7 +171,7 @@ class MockGuild(CustomMockMixin, unittest.mock.Mock, HashableMixin): spec_set = guild_instance def __init__(self, roles: Optional[Iterable[MockRole]] = None, **kwargs) -> None: - default_kwargs = {'id': next(self.discord_id), 'members': []} + default_kwargs = {'id': next(self.discord_id), 'members': [], "chunked": True} super().__init__(**collections.ChainMap(kwargs, default_kwargs)) self.roles = [MockRole(name="@everyone", position=1, id=0)] |