twenty/packages/twenty-server/src
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
..
command 6658 workflows add a first twenty piece email sender (#6965) 2024-09-12 11:00:25 +02:00
database [Emails migration] Fix email field migration (#7065) 2024-09-16 19:35:13 +02:00
engine Fix race condition with datasource creation (#7106) 2024-09-18 14:01:55 +02:00
modules [Emails migration] Fix email field migration (#7065) 2024-09-16 19:35:13 +02:00
queue-worker 6658 workflows add a first twenty piece email sender (#6965) 2024-09-12 11:00:25 +02:00
utils [POC] add graphql query runner (#6747) 2024-08-27 17:06:39 +02:00
app.module.ts Refactor metadata caching (#7011) 2024-09-12 16:06:19 +02:00
main.ts 6658 workflows add a first twenty piece email sender (#6965) 2024-09-12 11:00:25 +02:00