Skip to content

Commit 2911f69

Browse files
author
Parth Shah
committed
making direct project svc timeout configurable
1 parent 3f20c9d commit 2911f69

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

config/custom-environment-variables.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"esUrl": "PROJECTS_ES_URL",
99
"rabbitmqURL": "RABBITMQ_URL",
1010
"directProjectServiceEndpoint": "DIRECT_PROJECT_SERVICE_ENDPOINT",
11+
"directProjectServiceTimeout": "DIRECT_PROJECT_SERVICE_TIMEOUt",
1112
"fileServiceEndpoint": "FILE_SERVICE_ENDPOINT",
1213
"identityServiceEndpoint": "IDENTITY_SERVICE_ENDPOINT",
1314
"topicServiceEndpoint": "TOPIC_SERVICE_ENDPOINT",

config/default.json

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"topicServiceEndpoint": "",
1313
"identityServiceEndpoint": "",
1414
"directProjectServiceEndpoint": "",
15+
"directProjectServiceTimeout": 5000,
1516
"attachmentsS3Bucket": "topcoder-prod-media",
1617
"projectAttachmentPathPrefix": "projects",
1718
"projectAttachmentPathSuffix": "attachments",

src/services/directProject.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function _getHttpClient(req){
1616
httpClient.defaults.headers.common['Authorization'] = req.headers.authorization
1717
httpClient.defaults.headers.common['Content-Type'] = 'application/json'
1818
httpClient.defaults.baseURL = config.get('directProjectServiceEndpoint')
19-
httpClient.defaults.timeout = 4000
19+
httpClient.defaults.timeout = _.get(config, 'directProjectServiceTimeout', 5000)
2020
httpClient.interceptors.response.use((resp) => {
2121
// req.log.debug('resp: ', JSON.stringify(resp.data, null, 2))
2222
if (resp.status !== 200 || resp.data.result.status !== 200) {

0 commit comments

Comments
 (0)