diff options
author | Andrew Morgan <andrew@amorgan.xyz> | 2019-11-06 11:55:00 +0000 |
---|---|---|
committer | Andrew Morgan <andrew@amorgan.xyz> | 2019-11-06 11:55:00 +0000 |
commit | b33c4f7a828e722d6115f73525e0456edb79a90f (patch) | |
tree | 5855850456e8f99c8c641425659c6efe3a500551 /synapse/storage | |
parent | Fix bug which caused rejected events to be stored with the wrong room state ... (diff) | |
download | synapse-b33c4f7a828e722d6115f73525e0456edb79a90f.tar.xz |
Numeric ID checker now checks @0, don't ratelimit on checking
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/data_stores/main/registration.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/storage/data_stores/main/registration.py b/synapse/storage/data_stores/main/registration.py index f70d41ecab..ee1b2b2bbf 100644 --- a/synapse/storage/data_stores/main/registration.py +++ b/synapse/storage/data_stores/main/registration.py @@ -488,14 +488,14 @@ class RegistrationWorkerStore(SQLBaseStore): we can. Unfortunately, it's possible some of them are already taken by existing users, and there may be gaps in the already taken range. This function returns the start of the first allocatable gap. This is to - avoid the case of ID 10000000 being pre-allocated, so us wasting the - first (and shortest) many generated user IDs. + avoid the case of ID 1000 being pre-allocated and starting at 1001 while + 0-999 are available. """ def _find_next_generated_user_id(txn): - # We bound between '@1' and '@a' to avoid pulling the entire table + # We bound between '@0' and '@a' to avoid pulling the entire table # out. - txn.execute("SELECT name FROM users WHERE '@1' <= name AND name < '@a'") + txn.execute("SELECT name FROM users WHERE '@0' <= name AND name < '@a'") regex = re.compile(r"^@(\d+):") |