-
Notifications
You must be signed in to change notification settings - Fork 2
fix(PM-2539): added timeout for prisma client #3
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
Changes from all commits
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 |
|---|---|---|
| @@ -1,6 +1,11 @@ | ||
| const { PrismaClient } = require('@prisma/client'); | ||
| const config = require('config') | ||
|
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. [❗❗ |
||
|
|
||
| const prisma = new PrismaClient(); | ||
| const prisma = new PrismaClient({ | ||
| transactionOptions: { | ||
|
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. [❗❗ |
||
| timeout: config.MEMBER_SERVICE_PRISMA_TIMEOUT, | ||
| }, | ||
| }); | ||
|
|
||
| module.exports = prisma; | ||
|
|
||
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.
[⚠️
correctness]Consider validating the
RESOURCE_SERVICE_PRISMA_TIMEOUTenvironment variable to ensure it is a positive integer before usingparseInt. This will prevent potential issues if the environment variable is set to a non-numeric value or a negative number.