-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix data proxy unsupported before exit event #8274
Changes from 1 commit
f046643
adc6fe9
cf2a3ba
18c8de3
ee17058
300069e
799fe84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,13 +82,17 @@ 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'); | ||
}); | ||
|
||
// beforeExit event is not supported by Prisma Data Proxy | ||
if (!prismaClient._dataProxy) { | ||
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'); | ||
}); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we actually need this still? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am unable to replicate the original issue (#5477) if I remove this whole There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's drop it |
||
|
||
const context = makeCreateContext({ | ||
graphQLSchema, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm accessing the internal variable
prismaClient._dataProxy
here because the only alternative to check for dataProxy usage would be: