twenty/packages/twenty-server
Weiko 999974893c
Fix race condition with datasource creation (#7106)
## Context
We currently have a race condition when dealing with datasource
creation. This happen when multiple queries arrive at the same time (for
example graphql dataloaders) and the datasource is not created yet.
Since the datasource is stored in memory this can happen more often as
well and they were all triggering the datasource creation at the same
time.

I'm trying to fix the issue with promise memoization. Now, instead of
caching the datasource only, we also want to cache the promise of the
datasource creation and make the creation itself synchronous.

More info about promise memoization in this article for example:
https://www.jonmellman.com/posts/promise-memoization

Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
2024-09-18 14:01:55 +02:00
..
@types Trigger workflow run manually (#6696) 2024-08-21 17:41:26 +02:00
patches Improve performance twenty orm (#6691) 2024-08-20 19:42:02 +02:00
scripts Update render deploy configuration (#6167) 2024-07-09 00:27:07 +02:00
src Fix race condition with datasource creation (#7106) 2024-09-18 14:01:55 +02:00
test Optimize metadata queries (#7013) 2024-09-13 19:42:22 +02:00
.env.example fix(6423): add username and password for redis connection (#6745) 2024-09-04 16:56:37 +02:00
.env.test Rename mutation maximum affected records (#6042) 2024-06-26 18:00:25 +02:00
.eslintrc.cjs feat: add eslint rule for enforcing WorkspaceService naming convention (#6308) 2024-07-19 19:17:57 +02:00
.gitignore feat: workspace:health nullable fix (#3882) 2024-02-08 18:22:29 +01:00
.prettierignore Migrate to a monorepo structure (#2909) 2023-12-10 18:10:54 +01:00
.prettierrc Migrate to a monorepo structure (#2909) 2023-12-10 18:10:54 +01:00
.swcrc feat: twenty orm for standard and custom objects (#6178) 2024-07-19 18:23:52 +02:00
jest.config.ts 4840 multi workspace update user userworkspace inconsistent on delete set null constraint (#5373) 2024-05-13 14:50:27 +02:00
nest-cli.json Serverless function improvements (#6769) 2024-09-02 15:25:20 +02:00
package.json 6658 workflows add a first twenty piece email sender (#6965) 2024-09-12 11:00:25 +02:00
project.json Optimize sync, reset, seed commands to flush cache and to use less memory (#7034) 2024-09-15 12:47:45 +02:00
tsconfig.build.json chore: set up twenty-emails config so build isn't needed in development (#3619) 2024-01-29 06:17:12 -03:00
tsconfig.json feat: twenty orm for standard and custom objects (#6178) 2024-07-19 18:23:52 +02:00