Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ workflows:
branches:
only:
- develop
- pm-2539

# Production builds are exectuted only on tagged commits to the
# master branch.
Expand Down
3 changes: 2 additions & 1 deletion config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,6 @@ module.exports = {

HASHING_KEYS: {
USERFLOW: process.env.USERFLOW_PRIVATE_KEY
}
},
MEMBER_SERVICE_PRISMA_TIMEOUT: process.env.MEMBER_SERVICE_PRISMA_TIMEOUT ? parseInt(process.env.MEMBER_SERVICE_PRISMA_TIMEOUT, 10) : 10000,

Choose a reason for hiding this comment

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

[⚠️ correctness]
Consider adding validation to ensure process.env.MEMBER_SERVICE_PRISMA_TIMEOUT is a valid integer before parsing it with parseInt. This will prevent potential issues if the environment variable is set to a non-numeric value, which would result in NaN and default to 10000. You can use Number.isInteger() or similar checks for validation.

}
4 changes: 4 additions & 0 deletions src/common/prisma.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ const {
Prisma
} = require('../../prisma/generated/client')
const { PrismaClient: SkillsPrismaClient } = require('../../prisma/generated/skills-client')
const config = require('config')

const clientOptions = {
transactionOptions: {
timeout: config.MEMBER_SERVICE_PRISMA_TIMEOUT,

Choose a reason for hiding this comment

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

[❗❗ correctness]
Ensure that config.MEMBER_SERVICE_PRISMA_TIMEOUT is properly validated and has a sensible default value. If this value is undefined or set to an inappropriate value, it could lead to unexpected behavior in the transaction timeout.

},
log: [
{ level: 'query', emit: 'event' },
{ level: 'info', emit: 'event' },
Expand Down