Skip to content

Commit

Permalink
chore(client): change too many Prisma Client warning message (#10684)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 committed Dec 14, 2021
1 parent d8d01fb commit ec0a018
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getTestClient } from '../../../../utils/getTestClient'

test('too-many-engines warning', async () => {
test('too-many-instances-of-prisma-client warning', async () => {
const PrismaClient = await getTestClient()
const oldConsoleWarn = console.warn
const warnings: any[] = []
Expand All @@ -21,7 +21,7 @@ test('too-many-engines warning', async () => {

expect(warnings).toMatchInlineSnapshot(`
Array [
warn(prisma-client) There are already 10 Prisma Client engines actively running.,
warn(prisma-client) There are already 10 instances of Prisma Client actively running.,
]
`)

Expand Down
4 changes: 3 additions & 1 deletion packages/engine-core/src/binary/BinaryEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ You may have to run ${chalk.greenBright('prisma generate')} for your changes to
if (engines.length >= 10) {
const runningEngines = engines.filter((e) => e.child)
if (runningEngines.length === 10) {
console.warn(`${chalk.yellow('warn(prisma-client)')} There are already 10 Prisma Client engines actively running.`)
console.warn(
`${chalk.yellow('warn(prisma-client)')} There are already 10 instances of Prisma Client actively running.`,
)
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion packages/engine-core/src/library/LibraryEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ export class LibraryEngine extends Engine {
if (engines.length >= 10) {
const runningEngines = engines.filter((e) => e.engine)
if (runningEngines.length === 10) {
console.warn(`${chalk.yellow('warn(prisma-client)')} There are already 10 Prisma Client engines actively running.`)
console.warn(
`${chalk.yellow('warn(prisma-client)')} There are already 10 instances of Prisma Client actively running.`,
)
}
}
}
Expand Down

0 comments on commit ec0a018

Please sign in to comment.