Skip to content

Commit

Permalink
Remove prismaClient.$on('beforeExit'...) to assist with Prisma Data…
Browse files Browse the repository at this point in the history
… Proxy support (#8347)

* Fix dataproxy not supporting beforeExit event

* drop prisma onExit

* Add changeset

---------

Co-authored-by: Markus Machatschek <[email protected]>
  • Loading branch information
Josh Calder and mmachatschek authored Mar 1, 2023
1 parent aec152c commit 5051e5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/strange-baboons-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-6/core': patch
---

Removes `prismaClient.$on('beforeExit'...` as it is no longer required and blocked Prisma Data Proxy support
7 changes: 0 additions & 7 deletions packages/core/src/lib/createSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ export function createSystem(config: KeystoneConfig) {

setWriteLimit(prismaClient, pLimit(config.db.provider === 'sqlite' ? 1 : Infinity));
setPrismaNamespace(prismaClient, prismaModule.Prisma);
prismaClient.$on('beforeExit', async () => {
// Prisma is failing to properly clean up its child processes
// https://github.com/keystonejs/keystone/issues/5477
// We explicitly send a SIGINT signal to the prisma child process on exit
// to ensure that the process is cleaned up appropriately.
prismaClient._engine.child?.kill('SIGINT');
});

const context = makeCreateContext({
graphQLSchema,
Expand Down

0 comments on commit 5051e5a

Please sign in to comment.