aboutsummaryrefslogtreecommitdiffstats
path: root/alembic/env.py
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2024-06-30 18:57:23 +0100
committerGravatar Chris Lovering <[email protected]>2024-06-30 19:28:48 +0100
commit7898288420401566deef6c1cd23bde946bbfc614 (patch)
tree886e73f34e516cc844c514e65c11f1985019b7a8 /alembic/env.py
parentAdd dependabot config for docker & CI (diff)
Improve user in-guild sync process
Previously we set all users in_guild to False, and relied on users being set back to in_guild when iterating through guild.members However, this caused two problems 1. For a short window a users in_guild status was incorrect 2. It required an update for all users in_guild to be sent to postgres to update in_guild back to True. This diff changes that, so instead only users who are not found in the guild have in_guild set to False. The bottleneck for this query is the number of users that are currently in_guild=False. Testing locally, with 360k users off guild, this took 7.4s to query out, and 0.5s to process & 15.1 s to commit.
Diffstat (limited to 'alembic/env.py')
0 files changed, 0 insertions, 0 deletions