-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX slowness when adding user to workspace (#1205)
FIX slowness when adding user to workspace Summary: This PR addresses an issue where long and never-ending queries were causing failures in adding users to workspaces, especially in the French administration context. The solution involves splitting complex queries into simpler ones, removing promisifyAll around `getUsers` queries, and adding an index for faster queries. Test Plan: Existing tests Reviewers: fflorent, paulfitz, berhalak PR: #1205
- Loading branch information
1 parent
346c9fc
commit c945fac
Showing
5 changed files
with
94 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
app/gen-server/migration/1729754662550-LoginsEmailIndex.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {MigrationInterface, QueryRunner, TableIndex} from "typeorm"; | ||
|
||
export class LoginsEmailsIndex1729754662550 implements MigrationInterface { | ||
|
||
public async up(queryRunner: QueryRunner): Promise<any> { | ||
await queryRunner.createIndex("logins", new TableIndex({ | ||
name: "logins__email", | ||
columnNames: ["email"] | ||
})); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<any> { | ||
await queryRunner.dropIndex("logins", "logins__email"); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters