@@ -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