summary refs log tree commit diff
path: root/synapse/handlers/register.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-03-27 13:01:34 +0100
committerErik Johnston <erik@matrix.org>2018-03-27 13:01:34 +0100
commit3e0c0660b31827f9d13c1fb5153a77e70813d5d3 (patch)
tree5f05f922790d74cec1690b82622ae19d4ded80d2 /synapse/handlers/register.py
parentPEP8 (diff)
downloadsynapse-3e0c0660b31827f9d13c1fb5153a77e70813d5d3.tar.xz
Also do check inside linearizer
Diffstat (limited to 'synapse/handlers/register.py')
-rw-r--r--synapse/handlers/register.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py
index f1bf81ed7d..dd03705279 100644
--- a/synapse/handlers/register.py
+++ b/synapse/handlers/register.py
@@ -350,9 +350,10 @@ class RegistrationHandler(BaseHandler):
     def _generate_user_id(self, reseed=False):
         if reseed or self._next_generated_user_id is None:
             with (yield self._generate_user_id_linearizer.queue(())):
-                self._next_generated_user_id = (
-                    yield self.store.find_next_generated_user_id_localpart()
-                )
+                if reseed or self._next_generated_user_id is None:
+                    self._next_generated_user_id = (
+                        yield self.store.find_next_generated_user_id_localpart()
+                    )
 
         id = self._next_generated_user_id
         self._next_generated_user_id += 1