Skip to content

Commit 8a2ce6e

Browse files
authored
Merge pull request #735 from topcoder-platform/dev
Minor tweaks for ES-->OS transition for Opensearch Consolidation
2 parents 0a6a5d3 + 968a3f6 commit 8a2ce6e

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ The following parameters can be set in config files or in env variables:
6262
- ES.ES_INDEX: Elasticsearch index name
6363
- ES.ES_REFRESH: Elasticsearch refresh method. Default to string `true`(i.e. refresh immediately)
6464
- FILE_UPLOAD_SIZE_LIMIT: the file upload size limit in bytes
65+
- OPENSEARCH: Flag to use Opensearch NPM instead of Elasticsearch
6566
- RESOURCES_API_URL: TC resources API base URL
6667
- GROUPS_API_URL: TC groups API base URL
6768
- PROJECTS_API_URL: TC projects API base URL

src/common/helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const HttpStatus = require("http-status-codes");
1717
const xss = require("xss");
1818
const logger = require("./logger");
1919

20-
const { Client: ESClient } = require("@opensearch-project/opensearch");
20+
const { Client: OSClient } = require("@opensearch-project/opensearch");
2121
const elasticsearch = require("elasticsearch");
2222

2323
const projectHelper = require("./project-helper");
@@ -734,7 +734,7 @@ function getESClient() {
734734
});
735735
}
736736
} else {
737-
esClient = new ESClient({
737+
esClient = new OSClient({
738738
node: esHost,
739739
ssl: {
740740
rejectUnauthorized: false,

src/services/ChallengeService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ async function createChallenge(currentUser, challenge, userToken) {
884884
}
885885

886886
/** Ensure project exists, and set direct project id, billing account id & markup */
887-
if (challengeHelper.isProjectIdRequired(challenge.timelineTemplateId)) {
887+
if (challengeHelper.isProjectIdRequired(challenge.timelineTemplateId) || challenge.projectId) {
888888
const { projectId } = challenge;
889889

890890
const { directProjectId } = await projectHelper.getProject(projectId, currentUser);

0 commit comments

Comments
 (0)