Skip to content

Conversation

@hentrymartin
Copy link
Collaborator

What's this PR?

  • added timeout for prisma client

Ticket link - https://topcoder.atlassian.net/browse/PM-2539

this.client = new PrismaClient({ datasources: { db: { url } } });
this.client = new PrismaClient({
transactionOptions: {
timeout: process.env.BA_SERVICE_PRISMA_TIMEOUT

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
Consider validating process.env.BA_SERVICE_PRISMA_TIMEOUT before parsing it with parseInt. If the environment variable is not a valid number, parseInt will return NaN, which could lead to unexpected behavior. You might want to add a check to ensure it's a valid integer before using it.

super({
transactionOptions: {
timeout: process.env.BA_SERVICE_PRISMA_TIMEOUT
? parseInt(process.env.BA_SERVICE_PRISMA_TIMEOUT, 10)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
Consider adding a validation check to ensure that process.env.BA_SERVICE_PRISMA_TIMEOUT is a valid number before parsing it. If the environment variable is set to a non-numeric string, parseInt will return NaN, which could lead to unexpected behavior.

@kkartunov kkartunov merged commit 2ca7880 into develop Oct 28, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants