fix(nest): prevent concurrent NestJS application initialization#140
fix(nest): prevent concurrent NestJS application initialization#140lnqs wants to merge 1 commit intoaxe-me:mainfrom
Conversation
Added a locking mechanism to ensure only one NestJS application is initialized at a time, avoiding potential race conditions during simultaneous requests.
|
I'm working on a NestJS app using vite-plugin-node with a React frontend that triggers multiple requests at the same time. This reliably lead to all kind weird errors right after the dev server was started, when the web frontend was still open in the browser. After some investigation, I realized the NestJS app was initialized multiple times. This fix locks (deadly stupid, with a busy lock) the NestJS initializing to prevent this issue. Seems to work on my project. |
Added a locking mechanism to ensure only one NestJS application is initialized at a time, avoiding potential race conditions during simultaneous requests.