Fix registering a device on an account with lots of devices (#15348)

Fixes up #15183
This commit is contained in:
Erik Johnston 2023-03-29 14:37:06 +01:00 committed by GitHub
parent 5350b5d04d
commit f0d8f66eaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 56 additions and 3 deletions

View file

@ -946,6 +946,8 @@ class RegistrationHandler:
if not device_ids:
return
logger.info("Pruning %d stale devices for %s", len(device_ids), user_id)
# Now spawn a background loop that deletes said devices.
async def _prune_too_many_devices_loop() -> None:
if user_id in self._currently_pruning_devices_for_users: