From 708091fd37f0358aa5617f10a69056bfcbc023a1 Mon Sep 17 00:00:00 2001 From: chronotc Date: Thu, 31 Mar 2022 01:32:13 +1100 Subject: [PATCH] fix(engine-core): allow library engine to reestablish connection after initial error (#12066) --- packages/engine-core/src/library/LibraryEngine.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/engine-core/src/library/LibraryEngine.ts b/packages/engine-core/src/library/LibraryEngine.ts index e083d50dd410..48ff7977b090 100644 --- a/packages/engine-core/src/library/LibraryEngine.ts +++ b/packages/engine-core/src/library/LibraryEngine.ts @@ -335,7 +335,6 @@ You may have to run ${chalk.greenBright('prisma generate')} for your changes to ?.connect({ enableRawQueries: true }) .then(() => { this.libraryStarted = true - this.libraryStartingPromise = undefined debug('library started') resolve() }) @@ -349,6 +348,9 @@ You may have to run ${chalk.greenBright('prisma generate')} for your changes to reject(new PrismaClientInitializationError(error.message, this.config.clientVersion!, error.error_code)) } }) + .finally(() => { + this.libraryStartingPromise = undefined + }) }) return this.libraryStartingPromise }