Skip to content

Commit 6560a02

Browse files
authored
Merge pull request #3 from topcoder-platform/pm-2539
fix(PM-2539): added timeout for prisma client
2 parents c9bf7cd + 015878e commit 6560a02

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ workflows:
119119
only:
120120
- develop
121121
- hotfix/deploy
122-
- pm-2456
122+
- pm-2539
123123

124124
# Production builds are exectuted only on tagged commits to the testing
125125
# master branch.

config/default.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@ module.exports = {
5959
},
6060

6161
AUTOMATED_TESTING_NAME_PREFIX: process.env.AUTOMATED_TESTING_NAME_PREFIX || 'POSTMANE2E-',
62-
TOPCROWD_CHALLENGE_TEMPLATE_ID: process.env.TOPCROWD_CHALLENGE_TEMPLATE_ID || '517e76b0-8824-4e72-9b48-a1ebde1793a8'
62+
TOPCROWD_CHALLENGE_TEMPLATE_ID: process.env.TOPCROWD_CHALLENGE_TEMPLATE_ID || '517e76b0-8824-4e72-9b48-a1ebde1793a8',
63+
RESOURCE_SERVICE_PRISMA_TIMEOUT: process.env.RESOURCE_SERVICE_PRISMA_TIMEOUT ? parseInt(process.env.RESOURCE_SERVICE_PRISMA_TIMEOUT, 10) : 10000
6364
}

config/test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ module.exports = {
2121
COPILOT_CREDENTIALS_PASSWORD: process.env.COPILOT_CREDENTIALS_PASSWORD || '',
2222
USER_CREDENTIALS_USERNAME: process.env.USER_CREDENTIALS_USERNAME || '',
2323
USER_CREDENTIALS_PASSWORD: process.env.USER_CREDENTIALS_PASSWORD || '',
24-
AUTOMATED_TESTING_REPORTERS_FORMAT: process.env.AUTOMATED_TESTING_REPORTERS_FORMAT || ['cli', 'html']
24+
AUTOMATED_TESTING_REPORTERS_FORMAT: process.env.AUTOMATED_TESTING_REPORTERS_FORMAT || ['cli', 'html'],
25+
RESOURCE_SERVICE_PRISMA_TIMEOUT: process.env.RESOURCE_SERVICE_PRISMA_TIMEOUT ? parseInt(process.env.RESOURCE_SERVICE_PRISMA_TIMEOUT, 10) : 10000
2526
}

env.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ export DATABASE_URL="postgresql://johndoe:mypassword@localhost:5532/resourceapi?
3131
export MEMBER_DB_URL="postgresql://johndoe:mypassword@localhost:5632/memberdb"
3232

3333
export CHALLENGE_DB_URL="postgresql://johndoe:mypassword@localhost:5732/challengedb"
34+
35+
export RESOURCE_SERVICE_PRISMA_TIMEOUT=10000
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
const { PrismaClient } = require('@prisma/client');
2+
const config = require('config')
23

3-
const prisma = new PrismaClient();
4+
const prisma = new PrismaClient({
5+
transactionOptions: {
6+
timeout: config.MEMBER_SERVICE_PRISMA_TIMEOUT,
7+
},
8+
});
49

510
module.exports = prisma;
611

0 commit comments

Comments
 (0)