Skip to content

Manually chunk guild if not chunked 20s after startup#2152

Merged
wookie184 merged 2 commits into
mainfrom
chunnk-guild-if-not-chunked
May 1, 2022
Merged

Manually chunk guild if not chunked 20s after startup#2152
wookie184 merged 2 commits into
mainfrom
chunnk-guild-if-not-chunked

Conversation

@ChrisLovering
Copy link
Copy Markdown
Member

No description provided.

@ChrisLovering ChrisLovering requested a review from MarkKoz as a code owner April 26, 2022 18:17
Comment thread bot/exts/backend/sync/_cog.py
@wookie184
Copy link
Copy Markdown
Contributor

This will actually only sleep for 20s before attempting chunking. (there are 3 checks with 10s wait between then but the first one is at 0s).

Would it also be worth logging some sort of exception if the guild doesn't end up chunked? I don't think there is a reason it shouldn't eventually end up chunked, only that it might take a long time to do so. If it not chunking itself is a common occurence we'd probably want to know about it as it would cause problems elsewhere in the bot.

Also do we know what the behaviour if it was in the process of chunking and then guild.chunk is called is?

@ChrisLovering
Copy link
Copy Markdown
Member Author

ChrisLovering commented May 1, 2022

This will actually only sleep for 20s before attempting chunking. (there are 3 checks with 10s wait between then but the first one is at 0s).

Ah good point, I'll update PR title, not a big issue though.

Would it also be worth logging some sort of exception if the guild doesn't end up chunked? I don't think there is a reason it shouldn't eventually end up chunked, only that it might take a long time to do so

Guild.chunk() is blocking until the guild is successfully chunked. I cannot spot any errors that this would raise within the chunk nor ws impl, so I wouldn't not what exception to catch if we wanted to rethrow with a custom exception.

Also do we know what the behaviour if it was in the process of chunking and then guild.chunk is called is?

If a chunk is in progress, the same future will be waited for, rather than start a new chunk request. https://github.com/Rapptz/discord.py/blob/master/discord/state.py#L1101-L1112

@ChrisLovering ChrisLovering changed the title Manually chunk guild if not chunked 30s after startup Manually chunk guild if not chunked 20s after startup May 1, 2022
Copy link
Copy Markdown
Contributor

@wookie184 wookie184 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining that! This looks good to me

@wookie184 wookie184 enabled auto-merge May 1, 2022 22:23
@wookie184 wookie184 merged commit c527b87 into main May 1, 2022
@wookie184 wookie184 deleted the chunnk-guild-if-not-chunked branch May 1, 2022 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants