diff --git a/server/account/src/index.ts b/server/account/src/index.ts index 10cb738e4d..d8718bd537 100644 --- a/server/account/src/index.ts +++ b/server/account/src/index.ts @@ -639,7 +639,7 @@ async function generateWorkspaceRecord ( return { _id: id.insertedId, ...data } } const workspaceUrlPrefix = stripId(workspaceName) - const workspaceIdPrefix = stripId(getEmailName(email)).slice(0, 12) + '-' + workspaceUrlPrefix.slice(12) + const workspaceIdPrefix = stripId(getEmailName(email)).slice(0, 12) + '-' + workspaceUrlPrefix.slice(0, 12) let iteration = 0 let idPostfix = generateId('-') let urlPostfix = '' diff --git a/server/collaborator/src/starter.ts b/server/collaborator/src/starter.ts index 87f2f2ea00..a47f2e2cc0 100644 --- a/server/collaborator/src/starter.ts +++ b/server/collaborator/src/starter.ts @@ -47,8 +47,9 @@ export async function startCollaborator (): Promise { const shutdown = await start(metricsContext, config, minioClient, mongoClient) const close = (): void => { - void mongoClient.close() - void shutdown() + void shutdown().then(() => { + void mongoClient.close() + }) } process.on('uncaughtException', (e) => {