Skip to content

Commit a82aef5

Browse files
author
Sachin Maheshwari
committed
deploying on dev..
1 parent e864a47 commit a82aef5

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ workflows:
6767
context : org-global
6868
filters:
6969
branches:
70-
only: ['develop']
70+
only: ['develop', 'feature/migrate-small-chunks']
7171
- "build-prod":
7272
context : org-global
7373
filters:

scripts/updateToV5ChallengeIdSmallChunk.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const esClient = helper.getEsClient()
1717
* @param {Array} failedContainer The failed records container
1818
* @returns {Promise}
1919
*/
20-
function * updateRecord (submission, failedContainer) {
20+
function* updateRecord(submission, failedContainer) {
2121
let v5challengeId
2222
try {
2323
v5challengeId = yield helper.getV5ChallengeId(submission.challengeId)
@@ -47,23 +47,23 @@ function * updateRecord (submission, failedContainer) {
4747

4848
yield dbhelper.updateRecord(record)
4949
try {
50-
const response = yield esClient.update({
51-
index: config.get('esConfig.ES_INDEX'),
52-
type: config.get('esConfig.ES_TYPE'),
53-
id: submission.id,
54-
body: { doc: {challengeId: v5challengeId, legacyChallengeId: submission.challengeId} }
55-
})
56-
logger.info(`updated ES for submission ${submission.id}, response: ${JSON.stringify(response)}`)
57-
} catch (error) {
58-
logger.error(error.message)
59-
}
50+
const response = yield esClient.update({
51+
index: config.get('esConfig.ES_INDEX'),
52+
type: config.get('esConfig.ES_TYPE'),
53+
id: submission.id,
54+
body: { doc: { challengeId: v5challengeId, legacyChallengeId: submission.challengeId } }
55+
})
56+
logger.info(`updated ES for submission ${submission.id}, response: ${JSON.stringify(response)}`)
57+
} catch (error) {
58+
logger.error(error.message)
59+
}
6060
}
6161

6262
/*
6363
* Update all submission's challenge id to v5
6464
* @returns {Promise}
6565
*/
66-
function * updateRecords () {
66+
function* updateRecords() {
6767
const tableName = config.SUBMISSION_TABLE_NAME
6868
const promises = []
6969
const failedRecords = []
@@ -105,7 +105,7 @@ function * updateRecords () {
105105
}
106106
}
107107

108-
co(function * () {
108+
co(function* () {
109109
yield updateRecords()
110110
}).catch((err) => {
111111
logger.logFullError(err)

0 commit comments

Comments
 (0)