gristlabs_grist-core/app/server
Paul Fitzpatrick 29c2b35dcc (core) speed up a step in document deletion
Summary:
The `_repairWorkspaceGuests` method is slow for workspaces with large numbers of documents.  It makes a query that produces a lot of rows.  The query itself is tolerable, but TypeORM processing uses enough CPU to be a likely culprit in some production instability.  This diff splits the query into two pieces that are logically independent, but which when combined were resulting in the number of rows being the product of the two pieces.  Once split, there is also a where clause that can be applied to one of the pieces.

The purpose of the method is to add every user that a document within a workspace is shared with to a "guest" group of the workspace itself.  The design of "guest" groups is not ideal, but this diff leaves the design unchanged and is intended only to speed up operation.

Made some small tweaks to the timing of a flakey test, and temporarily recreated the `samples` directory removed in a previous diff (this is currently breaking tests badly on a fresh worker without a `samples` directory lying around)

Test Plan: added test; existing tests pass

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D2844
2021-06-02 16:06:26 -04:00
..
lib (core) speed up a step in document deletion 2021-06-02 16:06:26 -04:00
declarations.d.ts (core) Download as CSV button on sections 2021-05-27 15:48:12 +02:00
devServerMain.ts (core) make SELF_HYPERLINK urls cleaner 2021-05-28 08:54:37 -04:00
mergedServerMain.ts (core) add housekeeping endpoints for cleaning doc snapshots+state 2021-01-05 10:31:14 -05:00
serverMethods.ts (core) Download as CSV button on sections 2021-05-27 15:48:12 +02:00
tsconfig.json (core) move home server into core 2020-07-21 20:39:10 -04:00