Shorten group IDs

This commit is contained in:
Loporrit
2023-09-01 19:13:59 +00:00
parent cb8578859b
commit 0707d3eb54

View File

@@ -207,10 +207,10 @@ public partial class MareHub
throw new System.Exception($"Max groups for user is {_maxExistingGroupsByUser}, max joined groups is {_maxJoinedGroupsByUser}.");
}
var gid = StringUtils.GenerateRandomString(12);
var gid = StringUtils.GenerateRandomString(9);
while (await _dbContext.Groups.AnyAsync(g => g.GID == "LSS-" + gid).ConfigureAwait(false))
{
gid = StringUtils.GenerateRandomString(12);
gid = StringUtils.GenerateRandomString(9);
}
gid = "LSS-" + gid;