@@ -20,21 +20,21 @@ const QUERY_DELETE_CONTEST_ELIGIBILITY = 'DELETE FROM contest_eligibility WHERE
2020 * @return {Object } Informix statement
2121 */
2222async function prepare ( connection , sql ) {
23- logger . debug ( `Preparing SQL ${ sql } ` )
23+ // logger.debug(`Preparing SQL ${sql}`)
2424 const stmt = await connection . prepareAsync ( sql )
2525 return Promise . promisifyAll ( stmt )
2626}
2727
2828async function getGroupsForChallenge ( challengeLegacyId ) {
29- logger . debug ( `Getting Groups for Challenge ${ challengeLegacyId } ` )
29+ // logger.debug(`Getting Groups for Challenge ${challengeLegacyId}`)
3030 const connection = await helper . getInformixConnection ( )
3131 let groupIds = [ ]
3232 try {
3333 // await connection.beginTransactionAsync()
3434 const eligibilityId = await getChallengeEligibilityId ( connection , challengeLegacyId )
3535 if ( eligibilityId ) {
3636 groupIds = await getGroupIdsForEligibilityId ( connection , eligibilityId )
37- logger . debug ( `Groups Found for ${ challengeLegacyId } - ${ JSON . stringify ( groupIds ) } ` )
37+ // logger.debug(`Groups Found for ${challengeLegacyId} - ${JSON.stringify(groupIds)}`)
3838 }
3939 // logger.debug(`No groups Found for ${challengeLegacyId}`)
4040 // await connection.commitTransactionAsync()
@@ -89,11 +89,11 @@ async function removeGroupFromChallenge (challengeLegacyId, groupLegacyId) {
8989
9090 if ( groupEligibilityRecord ) {
9191 await deleteGroupEligibilityRecord ( connection , eligibilityId , groupLegacyId )
92- logger . debug ( 'Getting Groups Count' )
92+ // logger.debug('Getting Groups Count')
9393 const { groupsCount } = await getCountOfGroupsInEligibilityRecord ( connection , eligibilityId )
94- logger . debug ( `${ groupsCount } groups exist` )
94+ // logger.debug(`${groupsCount} groups exist`)
9595 if ( groupsCount <= 0 ) {
96- logger . debug ( 'No groups exist, deleting' )
96+ logger . debug ( 'No groups exist, deleting eligibility group ' )
9797 await deleteEligibilityRecord ( connection , eligibilityId )
9898 }
9999 }
@@ -117,9 +117,9 @@ async function removeGroupFromChallenge (challengeLegacyId, groupLegacyId) {
117117 */
118118async function getChallengeEligibilityId ( connection , challengeLegacyId ) {
119119 // get the challenge eligibility record, if one doesn't exist, create it and return the id
120- logger . info ( `getChallengeEligibilityId Query: ${ util . format ( QUERY_GET_ELIGIBILITY_ID , challengeLegacyId ) } ` )
120+ // logger.info(`getChallengeEligibilityId Query: ${util.format(QUERY_GET_ELIGIBILITY_ID, challengeLegacyId)}`)
121121 const result = await connection . queryAsync ( util . format ( QUERY_GET_ELIGIBILITY_ID , challengeLegacyId ) )
122- logger . info ( `getChallengeEligibilityId Result: ${ JSON . stringify ( result ) } ` )
122+ // logger.info(`getChallengeEligibilityId Result: ${JSON.stringify(result)}`)
123123 return ( result && result [ 0 ] ) ? result [ 0 ] . contest_eligibility_id : false
124124}
125125
@@ -130,9 +130,9 @@ async function getChallengeEligibilityId (connection, challengeLegacyId) {
130130 * @returns {Object } DB Result
131131 */
132132async function groupEligbilityExists ( connection , eligibilityId , groupLegacyId ) {
133- logger . debug ( `groupEligibiltyExists query ${ util . format ( QUERY_GET_GROUP_ELIGIBILITY_ID , eligibilityId , groupLegacyId ) } ` )
133+ // logger.debug(`groupEligibiltyExists query ${util.format(QUERY_GET_GROUP_ELIGIBILITY_ID, eligibilityId, groupLegacyId)}`)
134134 const result = await connection . queryAsync ( util . format ( QUERY_GET_GROUP_ELIGIBILITY_ID , eligibilityId , groupLegacyId ) )
135- logger . debug ( `groupEligibiltyExists result ${ JSON . stringify ( result ) } ${ JSON . stringify ( result [ 0 ] ) } ` )
135+ // logger.debug(`groupEligibiltyExists result ${JSON.stringify(result)} ${JSON.stringify(result[0])}`)
136136 return ( result && result [ 0 ] ) || false
137137}
138138
@@ -181,7 +181,7 @@ async function getCountOfGroupsInEligibilityRecord (connection, eligibilityId) {
181181
182182async function getGroupIdsForEligibilityId ( connection , eligibilityId ) {
183183 const query = util . format ( QUERY_GET_GROUPS , eligibilityId )
184- logger . debug ( `getGroupIdsForEligibilityId ${ query } ` )
184+ // logger.debug(`getGroupIdsForEligibilityId ${query}`)
185185 const result = await connection . queryAsync ( query )
186186 return _ . map ( result , r => r . group_id )
187187}
0 commit comments