mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-18 17:10:43 +03:00
Make room ID smaller
This commit is contained in:
parent
fe6e221cfa
commit
ae7460b9f4
1 changed files with 5 additions and 1 deletions
|
@ -79,6 +79,8 @@ class RoomCreationHandler(BaseHandler):
|
|||
# linearizer to stop two upgrades happening at once
|
||||
self._upgrade_linearizer = Linearizer("room_upgrade_linearizer")
|
||||
|
||||
self._next_room_id = 0
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def upgrade_room(self, requester, old_room_id, new_version):
|
||||
"""Replace a room with a new room with a different version
|
||||
|
@ -741,7 +743,9 @@ class RoomCreationHandler(BaseHandler):
|
|||
attempts = 0
|
||||
while attempts < 5:
|
||||
try:
|
||||
random_string = stringutils.random_string(18)
|
||||
i = self._next_room_id
|
||||
self._next_room_id += 1
|
||||
random_string = stringutils.random_string(3) + str(i)
|
||||
gen_room_id = RoomID(
|
||||
random_string,
|
||||
self.hs.hostname,
|
||||
|
|
Loading…
Reference in a new issue